Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I stun player until he clicks the button?

Asked by 4 years ago

Hi, I made script with customization. I have special camera to see player but when they making character they can move. How can I stun player until he clicks the button?

1 answer

Log in to vote
0
Answered by 4 years ago

If it is a Local script you can do this

local player = game.Players.LocalPlayer
repeat wait() until player.character -- makes sure player.character is there before assigning it as a value
local character = player.character
local humanoid = character.Humanoid

OnFunction:Connect() -- whatever function you want to enable this
    humanoid.WalkSpeed = 0 
        humanoid.JumpPower = 0 -- you probably don't want him/her to jump either
end

Just incorporate this into your code. It should work.

0
and vise versa for unstunning doomblade_66 55 — 4y
0
nah, doesn't work ThadonROOX 47 — 4y
0
Its not an actual function, I left the freedom of choosing your own event. Also I forgot function in the parenthesis on line 6. I'll get back to you with a tested code if that does'nt work doomblade_66 55 — 4y
Ad

Answer this question