Ive made a tool play an animation. But ive ran into a problem. I don’t understand how to make the character stop from moving and pressing buttons while playing the animation.
Use humanoid.WalkSpeed
and humanoid.JumpPower
When the tool is equipped, set them both to 0
I am not sure how to do the no clicking, give me a moment to try some stuff
- I am assuming you know how to access a player’s humanoid here as context
function onActivation()
-- if the player's humanoid exists then
-- change humanoid.walkspeed to 0
-- change humanoid.jumppower to 0
-- while activated
-- unbind player inputs X Y Z
end
tool.Activated:Connect(onActivation)
For specifc keyboard inputs you may want to disable or enable read more into the ContextActionService API
https://developer.roblox.com/en-us/api-reference/class/ContextActionService
So for clicking, I am assuming you mean guis. For that you would have to tell the server to ignore all remote events from the client. That way when a gui is clicked it will have no effect. If you have local gui stuff that happens after the click, you could have something that turn off these effects in your gui code.
There is probably a better way than this, but I cant think of it.
Pretty sure you can just disable the Player’s controls using the player module.
local Controls = Player.PlayerScripts.PlayerModule.Controls
Controls:Disable()
does that work for clicking buttons and stuff?
I don’t know actually, but it works for things like movement and jumping. You could probably use this and some other way to completely inhibit all player interaction.