Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isn't the ClickDetector doing anything?

Here's the script:

script.Parent.ClickDetector.MouseClick:Connect(function()
	game.Players.LocalPlayer.Character.UpperTorso.CFrame = CFrame.new(-41.544, 3.254, -8.141)
end)

It's a simple script, but every time I click the part nothing happens, This script has worked fine without any problems before, Why isn't it working?

1 comment

0

accept my answer

1 answer

✓ Accepted answer

You can't access LocalPlayer from a serverscript. MouseClick takes a parameter of the player who clicked.


script.Parent.ClickDetector.MouseClick:Connect(function(plr)

plr.Character.UpperTorso.CFrame = CFrame.new(-41.544, 3.254, -8.141)

end)

3 comments

0

Thanks, this worked!

0

accept as answer

0

Stop being xp hungry

This discussion is preserved as it was. New answers, comments, and votes are closed.