It ran an error and this is my code:
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local Hum = player.Character.Humanoid local animation = script.Animation local kick = Hum:LoadAnimation(animation) mouse.Button1Down:Connect(function() kick:Play() end)
The script is a LocalScript in
StarterPlayer > StarterPlayerScripts > LocalScript
I would recommend putting the script in StarterCharacterScripts since it modifies the character. Since the player loads in before the character when someone joins, it can cause issues like this where the character doesn't exist yet but it still tries to run the rest of the code.
Otherwise, you could probably put player.CharacterAdded:Wait()
under the first line of your code to make sure the character exists before trying to do anything else if you don't want to move it
put a player.Character:WaitForChild("Humanoid")
instead of player.Character.Humanoid