I have tried a script where I press a key and it makes an animation happen. For some reason, the script only works when I jump. This is a Server Script.
local repstorage = game:WaitForChild("ReplicatedStorage")
local Remote = repstorage:WaitForChild("IceStart")
Remote.OnServerEvent:connect(function(player)
local char = player.Character
script.Dmg.Player.Value = player.Name
local folder = workspace:FindFirstChild("DebrisFolder") or Instance.new("Folder",workspace)
folder.Name = "DebrisFolder"
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://000"
local Move = char.Humanoid:LoadAnimation(Anim)
Move:Play()
local position = Instance.new("BodyVelocity",char.HumanoidRootPart)
position.MaxForce = Vector3.new(99999999999999,99999999999999,99999999999999)
position.P = 300
position.Velocity = char.HumanoidRootPart.CFrame.LookVector * 1
game.Debris:AddItem(position,2)
There is also another script that connects to make that work.
local repstorage = game:WaitForChild("ReplicatedStorage")
local Remote = repstorage:WaitForChild("IceStart")
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
cool = true
Mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "z" then
if cool ~= true then return end
cool = false
Remote:FireServer()
wait(5)
cool = true
end
end)

3 comments
keydown is decaperated
Thanks. keyDown now or just keydown
no use UserInputService, InputBegan