I tried making keybind animations. They work just fine aside the error:
AnimationId failed to load
or something.
Here's the script:
local rs = game:GetService("ReplicatedStorage")
local e1 = rs.Move1Play
local e2 = rs.Move2Play
local e3 = rs.Move3Play
local e4 = rs.Move4Play
local id1 = workspace.MoveId1 -- The value is 4951461649
local id2 = workspace.MoveId2 -- The value is 4951461649
local id3 = workspace.MoveId3 -- The value is 4946579253
local id4 = workspace.MoveId4 -- The value is 4946579253
do
local function play1(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local h = char:FindFirstChild("Humanoid")
local anim = Instance.new("Animation")
if id1.Value then
anim.AnimationId = "http://www.roblox.com/asset/?id=" .. tostring(id1.Value)
end
local track = h:LoadAnimation(anim)
track:Play()
end
e1.OnServerEvent:Connect(play1)
end
do
local function play2(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local h = char:FindFirstChild("Humanoid")
local anim = Instance.new("Animation")
if id2.Value then
anim.AnimationId = "http://www.roblox.com/asset/?id=" .. tostring(id2.Value)
end
local track = h:LoadAnimation(anim)
track:Play()
end
e2.OnServerEvent:Connect(play2)
end
do
local function play3(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local h = char:FindFirstChild("Humanoid")
local anim = Instance.new("Animation")
if id3.Value then
anim.AnimationId = "http://www.roblox.com/asset/?id=" .. tostring(id3.Value)
end
local track = h:LoadAnimation(anim)
track:Play()
end
e3.OnServerEvent:Connect(play3)
end
do
local function play4(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local h = char:FindFirstChild("Humanoid")
local anim = Instance.new("Animation")
if id4.Value then
anim.AnimationId = "http://www.roblox.com/asset/?id=" .. tostring(id4.Value)
end
local track = h:LoadAnimation(anim)
track:Play()
end
e4.OnServerEvent:Connect(play4)
end

4 comments
No need to make 3 functions for practically the same operation. I can't really tell what is happening since I haven't an idea as to how those ids actually look, but it seems Roblox is failing to load your ids. So, if I were you, I would make a table of all those ids and set anim.AnimationId equal to each table using a for loop.
Also, no need to use that 'do' statement either.
Any ideas on how to fix it though?
Those are the values.