When you touch this brick, it will clone this local script into the players Gui. However, it doesn't work whenever I press h...
local Mouse = game.Players.LocalPlayer:GetMouse() local chr = game.Players.LocalPlayer.Character function onKeyDown(key) key = key:lower() if key == "h" then local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=1567452314" wait() local trackanimation = chr.Humanoid:LoadAnimation(animation) trackanimation:Play() end end Mouse.KeyDown:connect(onKeyDown)
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:wait() local Human = Character:WaitForChild("Humanoid") local Mouse = Player:GetMouse() local anim = Instance.new("Animation", Human) anim.AnimationId = "http://www.roblox.com/asset/?id=01468567293" --Type your animation id here mouse.KeyDown:connect(function(key) key = key:lower() if key == 'h' then local animTrack = Human:LoadAnimation(anim) animTrack:Play() end end)
This script should work.
And don't make it in local script, use normal script.