https://gyazo.com/2d72010dd31b46ae69f101513bfb643f
Heres local script
local Player = game:GetService("Players")
local rp = game:GetService("ReplicatedStorage")
local Lancer = rp:WaitForChild("Lancer")
local UIS = game:GetService("UserInputService")
local debounce = false
local cooldown = 1
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
elseif input.KeyCode == Enum.KeyCode.E and debounce == false then
debounce = true
Lancer:FireServer()
end
end)
Lancer.OnClientEvent:Connect(function()
wait(cooldown)
debounce = false
end)
And normal script
local rp = game:GetService("ReplicatedStorage")
local Lancer = rp:WaitForChild("Lancer")
local Animation = game.Workspace.Animations:WaitForChild("Swing")
Lancer.OnServerEvent:Connect(function(Player)
local Character = Player.Character
local Humanoid = Character:FindFirstChild("Humanoid")
local LoadedAnimation = Humanoid:LoadAnimation(Animation)
LoadedAnimation:Play()
end)

2 comments
dude im dumb can u tel me how to put it in the script :)
I'd recommend reading up about it so you learn first hand. Good luck! https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events