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

How do I freeze a player when joined in R6?

Asked by 5 years ago

I tried making a freeze script for my game but it won't work. Here's my code.

function onJoined(newPlayer)
    newPlayer.Character.Humanoid.WalkSpeed = 0
end

game.Players.PlayerAdded:connect(onJoined)

While making a script and putting it into Studio and testing it. The player still can walk.

0
really? it should do what it is suposed to do nothing is wrong starmaq 1290 — 5y
0
What exactly are you trying to do? Freeze R6 players or fix the script you have given us? You're giving an XY problem. User#24403 69 — 5y

3 answers

Log in to vote
1
Answered by
ADUPS 5
5 years ago
Edited 5 years ago

you can anchor the primary part (HumanoidRootPart)

function onJoined(newPlayer)
    newPlayer.Character.PrimaryPart.Anchored=true
end

game.Players.PlayerAdded:connect(onJoined)

make sure its a server script

0
yah do this starmaq 1290 — 5y
0
There is still a problem. They can reset. User#24403 69 — 5y
0
then disable the reset button. I don't remember how to do it but its possible ADUPS 5 — 5y
0
But if you change the script a little bit and put it into starter character scripts that will work Miniller 562 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local humanoid = character:FindFirstChild("Humanoid")
    end)
while true do
if humanoid.RigType == Enum.HumanoidRigType.R6 then
   character.Torso.Anchored = true
   humanoid.Died:Connect(function()
        wait()
        player:LoadCharacter()
     end)    
end

Please tell me if I’m wrong because I’m on mobile and cannot test the script

Log in to vote
0
Answered by 5 years ago

I think THIS is what you're looking for:

wait()
pcall(function()
    game:GetService("StarterGui"):SetCore("ResetButtonCallback", false) -- Player can't reset
end)

After this, you can anchor the HumanoidRootPart and the player will be stuck. Evil, but this is what you could do.

0
The script must be local AND in StarterPlayerScripts DeceptiveCaster 3761 — 5y

Answer this question