pretty simple how can i make the player do an animation when they press Q
i just need the script not the animation
local UserInputService = game:GetService("UserInputService")
local Animation = YourAnimationHere
local Key = Enum.KeyCode.Q
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Key then
print("Q was pressed!")
Animation:Play()
end
end)
tbh you could’ve searched it up and get the answer you want
That only plays it locally though right?
yeah it needs to be a local script
So the solution to that would be to send a remote event and play the animation from there
lemme try this
i posted on devforum since its more specific and easier to communicate
where do i put the script?
In a local script, StarterPlayerScripts for example.
im kinda confused i have a local script in StarterPlayerScripts and i put my animation id but it doesnt work i didnt expect it to work but im not rly sure why it doesnt
Could you send the code you are using?
ive got the code working thank you to everyone that helped
No, animations played through client-controlled characters will replicate to the server.
https://developer.roblox.com/en-us/api-reference/class/Animator