local on = false
game.ReplicatedStorage.Actions.Sleep.OnServerEvent:Connect(function(plr) -- When event have been enable
local anim = plr.Character.Actions -- Finding The Action Folder
local char = plr.Character -- To know character
local hum = char:WaitForChild("Humanoid") -- Find The Humanoid of character
local track = hum:LoadAnimation(anim:FindFirstChild("Sleep")) -- Name of Action
track.Looped = true
if on == false then
on = true
track:Play() -- Play The Animtion
-- Nothing
elseif on == true then
on = false
track:Stop()--Stops the animation
--end this script
end
end)
i make it when press the button, Animation in character will play, When press button again then stop, but I don't know what is wrong with this script , The Play Does work, but the Stop animation is don't work , Maybe just watch the video, you will understand
I want someone to fix this, or tell me the problem, I would be so** thankful**
Also sorry if i have some grammar mistake or issue
** You are now Level 2! **