of     1   

xiaoxiao181
#24464818Sunday, April 18, 2010 5:22 PM GMT

i know when you wanna look for a character from game.Players you simply script it in as, for the sake of example, PlaerGui.Parent.Character but how do you do that backwards? As in start from the character and go to the player? forgive me, i didnt know what terminology to use for this question
ElectricAxel
#24464851Sunday, April 18, 2010 5:23 PM GMT

game.Players:GetPlayerFromCharacter(character)--> returns player
xiaoxiao181
#24468383Sunday, April 18, 2010 6:22 PM GMT

and I replace character with the name of the character or just leave it?
ElectricAxel
#24468662Sunday, April 18, 2010 6:27 PM GMT

no, with the model, for example, in .Touched events with hit as the argument: player = game.Players:GetPlayerFromCharacter(hit.Parent)
xiaoxiao181
#24469025Sunday, April 18, 2010 6:33 PM GMT

ok, but wut if its not a touched or clicked event? it's more of a changed event >.< maybe if i give you the script you can just fix it, right? what it is, is a map reset script, but it doesnt activate until the player's leaderstats.Life.Value == 0
qrcrist
#24469191Sunday, April 18, 2010 6:36 PM GMT

you dont script mutch do you..
xiaoxiao181
#24469394Sunday, April 18, 2010 6:39 PM GMT

nobody asked you, im talking to ElectricAxel
ElectricAxel
#24489008Monday, April 19, 2010 12:03 AM GMT

sure, I'll help, lemme see script, and btw, ClickDetectors are sort of unknown, there is no way to know who clicked
xiaoxiao181
#24492054Monday, April 19, 2010 12:50 AM GMT

It's supposed to reset the owner of the "tycoon" pathing map for my ele td game when his Life.Value == 0 just so it's clearer for you, Life = game.Players."Player".leaderstats.Life Player being of course whoever is playing the game. function Check(Td,Player) local LTd = Td local OTd = Td:Clone() Player.leaderstats.Life.Changed:connect(function(p) if LTd.Owner.Value ~= p then if Player.leaderstats.Life.Value == 0 then Player.Character.Humanoid.Health = 0 wait(1) LTd:Remove() OTd.Parent = workspace Check(OTd) end end end) end function search(obj) if obj.Name == "Owner" and obj.className == "ObjectValue" then Check(obj.Parent,obj.Value) end for i, v in pairs(obj:GetChildren()) do search(v); end end search(workspace); it kept giving me this error: Sat Apr 17 10:47:46 2010 - Running Script 'Script' Sat Apr 17 10:47:46 2010 - Player is not a valid member of Players Sat Apr 17 10:47:46 2010 - Workspace.Script, line 4 - global Check Workspace.Script, line 19 - global search Workspace.Script, line 22 - global search Workspace.Script, line 22 - global search Workspace.Script, line 25 stack end
ElectricAxel
#24492503Monday, April 19, 2010 12:56 AM GMT

yeah, tycoons with no owners have no owner (duh? lol) so it will say they don't exist: function Check(Td,Player) local LTd = Td local OTd = Td:Clone() Player.leaderstats.Life.Changed:connect(function(p) if LTd.Owner.Value ~= p then if Player.leaderstats.Life.Value == 0 then Player.Character.Humanoid.Health = 0 wait(1) LTd:Remove() OTd.Parent = workspace Check(OTd) end end end) end function search(obj) if obj.Name == "Owner" and obj.className == "ObjectValue" then if obj.Value~=nil then Check(obj.Parent,obj.Value) end end for i, v in pairs(obj:GetChildren()) do search(v); end end search(workspace);

    of     1