Hello so i am trying to do this script ~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~local anime = script.Parent.name.Value local brick = script.Parent local debounce = false
function onTouch(plr) if not debounce then local hum = game.Players:GetPlayerFromCharacter(plr.Parent) local humanoid = plr.Parent:FindFirstChild("Humanoid") local anim_load = humanoid:LoadAnimation(script.Parent.Animation) local current = anim_load current:Play() debounce = true end wait(3) debounce = false end brick.Touched:connect(onTouch)**** So anyways the script wont work, and the script is in a part and when i touch it i want a animation plays. Please reply
do this inside a serverscript inside the part
local debounce = false -- Inside a serverScript btw part.Touched:Connect(function(hit) if not debounce then if hit.Parent:FindFirstChild("Humanoid") then debounce = true local humanoid = hit.Parent.Humanoid -- Getting the humanoid humanoid:LoadAnimation(youranimationhere):Play() -- Playing the animation wait(2) debounce = false end end end)