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
Use rbxassetid://
when using the animation.
You either haven’t made a GUI or didn’t put it in the GUI. If you haven’t made a GUI then the animation won’t work for reasons that can be answered easily.