of     1   

DracoTheSecond
#139679007Tuesday, July 08, 2014 8:49 PM GMT

Hey everyone, So I'm making a script which, when a Player enters, will move a ClickDetector into their torso. Here is the script I have: function onPlayerEntered(NewPlayer) local CD = Instance.new("ClickDetector") local PlayerName = NewPlayer.Name CD.Parent = game.Workspace:FindFirstChild("" ..PlayerName).Torso end game.Players.PlayerAdded:connect(onPlayerEntered) No output... I know there is the method :GetPlayerFromCharacter but is there a :GetCharacterFromPlayer
wish_z
#139679184Tuesday, July 08, 2014 8:51 PM GMT

.Character like game.Players.WishNite.Character
DracoTheSecond
#139679423Tuesday, July 08, 2014 8:53 PM GMT

function onPlayerEntered(NewPlayer) local CD = Instance.new("ClickDetector") local PB = NewPlayer.Character CD.Parent = game.Workspace.PB.Torso end game.Players.PlayerAdded:connect(onPlayerEntered) Not working...
Brick_man
#139679856Tuesday, July 08, 2014 8:56 PM GMT

Change: CD.Parent = game.Workspace.PB.Torso to: CD.Parent = PB.Torso
DracoTheSecond
#139680157Tuesday, July 08, 2014 8:59 PM GMT

function onPlayerEntered(NewPlayer) local CD = Instance.new("ClickDetector") local PB = NewPlayer.Character CD.Parent = PB.Torso end game.Players.PlayerAdded:connect(onPlayerEntered) No output still... I'm quite a good scripter but this is just weird. I don't really edit Characters much.
Lacryma
#139680790Tuesday, July 08, 2014 9:04 PM GMT

function onPlayerEntered(NewPlayer) local CD = Instance.new("ClickDetector") local PB = NewPlayer.CharacterAdded:wait() CD.Parent = PB.Torso end game.Players.PlayerAdded:connect(onPlayerEntered)
DracoTheSecond
#139681787Tuesday, July 08, 2014 9:13 PM GMT

Okay I added the script and it works... I've also made it add a script to the Player's torso (an OnClick script) When I click the torso, no output but the Icon for a click detector doesn't show up. Do you have to have something in the player to be able to click the torso?
DracoTheSecond
#139682518Tuesday, July 08, 2014 9:20 PM GMT

Anyone?
fireblade2
#139682681Tuesday, July 08, 2014 9:21 PM GMT

The torso may be overlapped by HumanoidRootPart, or ClickDetectors don't work in the character.
DracoTheSecond
#139682819Tuesday, July 08, 2014 9:22 PM GMT

Hmm... Okay How would I get round the problem?
fireblade2
#139683844Tuesday, July 08, 2014 9:31 PM GMT

Try 'HumanoidRootPart' instead of 'Torso'.

    of     1