im trying to make it so when you press e, you do an animation, but it says it can’t get the players character
here is the code:
local Shake = game.ReplicatedStorage.Shake
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.character
local humanoid = character:FindFirstChild("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=5125401222" -- Roblox dance emote
local animationTrack = humanoid:LoadAnimation(animation)
Shake.OnServerEvent:Connect(function(plr)
animationTrack:Play()
end)
and I get this error
15:10:38.359 - ServerScriptService.AnimationManagement.Shake:7: attempt to index nil with 'character'