Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do I freeze a player when joined in R6?

Asked by 6 months 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 834 — 6mo
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. incapaxx 3479 — 6mo

3 answers

Log in to vote
1
Answered by
ADUPS 5
6 months ago
Edited 6 months 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 834 — 6mo
0
There is still a problem. They can reset. incapaxx 3479 — 6mo
0
then disable the reset button. I don't remember how to do it but its possible ADUPS 5 — 6mo
0
But if you change the script a little bit and put it into starter character scripts that will work Miniller 364 — 6mo
Ad
Log in to vote
0
Answered by 6 months ago
Edited 6 months 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
BashCaster 2324 Moderation Voter Community Moderator
6 months 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 BashCaster 2324 — 6mo

Answer this question