UIS = game:GetService("UserInputService") plr = game.Players.LocalPlayer ctr = plr.Character or plr.CharacterAdded:Wait() hum = ctr:WaitForChild('Humanoid') an = Instance.new("Animation") an.AnimationId = "https://www.roblox.com/asset?id=".."2695066337"--id antrack = hum:LoadAnimation(an) db = true strength = plr:WaitForChild("Stats"):WaitForChild("Strength") UIS.InputBegan:Connect(function(key) if key.KeyCode == Enum.KeyCode.T and db == true then db = false local speed = hum.WalkSpeed strength.Value = strength.Value + 10 antrack:Play() wait(2) speed = nil db = true end end)
I've made this script and I've tried anchoring humanoidrootpart and the player can still move. I made the walkspeed and jump power 0 but the animation just stopped working or if you don't get it the animation only partly works by just rotating a slightly bit then going back to normal
My goal: Make the player do the animation and stop moving or jumping when clicked t.
Try this! (Please read what I have said after this script)
EDITED
UIS = game:GetService("UserInputService") an = Instance.new("Animation") an.AnimationId = "https://www.roblox.com/asset?id=".."2695066337"--id antrack = hum:LoadAnimation(an) db = true game.Players.PlayerAdded:Connect(function(plr)--// Player added plr.CharacterAdded:Connect(function(char) --// Character added strength = plr:WaitForChild("Stats"):WaitForChild("Strength") UIS.InputBegan:Connect(function(key) if key.KeyCode == Enum.KeyCode.T and db == true then db = false strength.Value = strength.Value + 10 antrack:Play() wait(2) char.Humanoid.WalkSpeed = 1--// We are changing Walkspeed to 1 char.Humanoid.JumpPower =1 --// We are changing JumpPower to 1 db = true end end)
I have edited your script anything broken please tell me in comments
If I cannot help further please use this to help you make it yourself (or if no-one else helps or their answers don't work):
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) char.Humanoid.JumpPower = 1 char.Humanoid.WalkSpeed = 1 end) end)