Heres the local script
I hope its right, (tell me if its not)
So i want it to play an animation in the script after i press E
Local Script:
https://gyazo.com/4e7bf07c141ca5b4970cee40aa95fb25
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)
I want it to fire the script in serverscriptservice
this is what i have rn
local rp = game:GetService("ReplicatedStorage") local Lancer = rp:WaitForChild("Lancer")
Hopefully this should work:
local rp = game:GetService("ReplicatedStorage") local Lancer = rp:WaitForChild("Lancer") local Animation = AnimationFolderHere:WaitForChild("AnimationNameHere") -- Find the animation Lancer.OnServerEvent:Connect(function(Player) -- Listen to event fire local Character = Player.Character -- Get the player's character local Humanoid = Character:FindFirstChild("Humanoid") local LoadedAnimation = Humanoid:LoadAnimation(Animation) -- Load the animation LoadedAnimation:Play() -- Play the animation Lancer:FireClient(Player) end)