Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

click detector on custom starter character?

Asked by 1 month 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 265 Moderation Voter
1 month ago
Edited 1 month 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