#help with click detectors

1 messages · Page 1 of 1 (latest)

viscid heath
#

im trying to make an animated rig change ur walk/run with a click detector, but when i do multiple for some reason only one script works on all of them. and my rigs move around when i walk into them

this is my code:
'''lua
local clickDetector = script.Parent

game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
wait(3)
char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://102856364027403"
char.Animate.run.RunAnim.AnimationId = "rbxassetid://102856364027403"
end)
end)
'''

viscid heath
#

.

trail plaza
# viscid heath im trying to make an animated rig change ur walk/run with a click detector, but ...

local clickDetector = script.Parent -- Put this inside the part with ClickDetector

clickDetector.MouseClick:Connect(function(player)
local char = player.Character
if not char then return end

local animate = char:FindFirstChild("Animate")
if not animate then return end

-- Change walk/run animations
animate.walk.WalkAnim.AnimationId = "rbxassetid://102856364027403"
animate.run.RunAnim.AnimationId = "rbxassetid://102856364027403"

end)

#

Put this inside the same part that has the ClickDetector.

Make sure your rig/part with the ClickDetector is anchored so players don’t push it around.

If you want multiple ClickDetectors with different animations, just copy this script into each and change the AnimationId.

viscid heath
oak kettleBOT
#

studio** You are now Level 1! **studio

viscid heath
trail plaza
oak kettleBOT
#

studio** You are now Level 1! **studio

trail plaza
#

if you need help with anything else feel free to dm me

viscid heath
trail plaza
#

or a dummy

viscid heath
#

humanoid i believe

trail plaza
viscid heath
#

should i make it a dummy so it can be animated and anchored?

trail plaza
#

Thats how you can make it a dummy

viscid heath
#

tysmm ur a god send ive been trying to figure this out forever