Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

click detector on custom starter character?

Asked by 4 years ago

I would like to make it so when you click a certain part on my custom character, it does an action, but the click detector wont show up ingame

1 answer

Log in to vote
1
Answered by
VAHMPIN 277 Moderation Voter
4 years ago
Edited 4 years ago

You can add a target part to your custom character and do a click detector on that part,

after that you can do this in a LocalScript in the player GUI:

game.Players.LocalPlayer.Character.TargetPart.ClickDetector.MouseClick:Connect(function()
 -- if you want it to replicate use a remote event otherwise put your code in here
end)

Animation:

( This is not replicated )

game.Players.LocalPlayer.Character.TargetPart.ClickDetector.MouseClick:Connect(function()
 local animationid = "rbxassetid://ANIM"
 local player = game.Players.LocalPlayer

 local  load = player.Character.Humanoid:LoadAnimation(animationid)
load:Play()
end)
Ad

Answer this question