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

click detector on custom starter character?

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

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)

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