Clickdetector don't working or script?

Hello there, I was coding my script
but There is no error no function fired when I click on button

	player.Character.HumanoidRootPart.CFrame = game.Workspace["Lift "..script.Parent.Name]["Floor lift"].CFrame +,1,0)

Thank for reading


ClickDetectors work differently than UI buttons, in terms of what events you can use on it.

.MouseClick is a valid event.

Well then I have no Idea :smiley: lol

1 Like

Try adding vector3 to the position, not CFrame, or multiply it’s current CFrame by CFrame)

Try to use function while changing the position of the player.

1 of all It’s don’t show icon of clickdetector
2 of all Any function isn’t fired
3 of all Part is concolllide = true and transparency = 0

Can you show us your workspace explorer so we can see where are your things located, please.


Do .position instead of .CFrame, and your scripts would be much cleaner if you didn’t name things with spaces.

What if you try to connect it with remote events? put the localscript inside startergui and connect the click detector in it on clicked then fire event from the client to script and do your thing with brick in script?

Starter gui has nothing to do with a click detector, and only a single server script is needed for click detectors.

Alright, the issue is you can disconnect the HumanoidRootPart from the body, but the rest of the character won’t follow. It’s best to use :SetPrimaryPartCFrame, which moves the full model:

   player.Character:SetPrimaryPartCFrame(game.Workspace["Lift "..script.Parent.Name]["Floor lift"].CFrame +,2.5,0))

Also, I would move this into a local script, as ClickDetectors work better in that way, namely due to filtering enabled wrecking click detectors, and use a remote event.
cc @gamerobotjimmy

1 Like