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:

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

Animation:

( This is not replicated )

1game.Players.LocalPlayer.Character.TargetPart.ClickDetector.MouseClick:Connect(function()
2 local animationid = "rbxassetid://ANIM"
3 local player = game.Players.LocalPlayer
4 
5 local  load = player.Character.Humanoid:LoadAnimation(animationid)
6load:Play()
7end)
Ad

Answer this question