How to stop (specific) player from spawning?

Hello, I want to stop a player from spawning, but only a specific person. Any ideas?
I’ve looked on the forum but I’ve only been able to find the CharacterAutoLoads property which doesn’t do what I want to do, stopping a SPECIFIC player from spawning.

Any help greatly appreciated.

1 Like

Set characterAutoLoads to false.
When players join set a humanoid.died event with a logic condition to check the player’s userid.
Create a table of player userids you want to not spawn.
If the player’s userid is not on the table call loadcharacter.
Something like this…

local Players = game:GetService("Players")
Players.CharacterAutoLoads = false
local noSpawn = {--userids}
Players.PlayerAdded:Connect(function(player)
    if not table.find(noSpawn, player.Userid) then
        player:LoadCharacter()
        player.CharacterAdded:Connect(function(char)
  
          char.Humanoid.Died:Connect(function()
            player:LoadCharacter()
        end)
    end)
    else
        --code if not spawning
    end
end)
1 Like

It would be good though if there was a property in the player you could just disable… I don’t really want to set CharacterAutoLoads to false. Any other ideas?

But I guess if I have to, I will.

Other than forcing them to spawn in a holding zone and disabling their inputs/moving their camera.
Depends on what you want to do with them afterwards?

Well, it’s an admin command that makes some GUI stuff happen, and after that the GUI never disappears and the admin will run the punishment command on him, making him leave the game anyway. So i don’t want to do anything with him. I could just make him invisible, freeze him, turn his CanCollide off and send him to 0, 0, 0.

So how do i stop a player from resetting their character (grey out the reset character button like in some games)?

(also i have to go eat dinner ill be back)

To disable the reset button, you have to disable the ResetButtonCallBack feature.

If you’d want to do it to a specific player, I would recommend creating a certain script that can duplicate the script im going to talk about into the player’s PlayerGui folder.

To start the disableresetbutton script, go ahead and grab the StarterGui from game:GetService:
local stgui = game:GetService("StarterGui")

Finally, add a wait for at least a second, then we are going to get the ResetButtonCallBack feature from Roblox and set it to false.

wait(1) stgui:SetCore("ResetButtonCallback" ,false)

Make sure all of the code is inside of a LocalScript and is tested either in StarterGui or StarterPlayer > StarterPlayerScripts. (client script)

Admin command scripts’ punish command work by setting the Parent of the victim’s Character to nil. Doing so removes their character from the game and prevents them from re-spawning.

Tysm, works perfectly. Can’t reset, and is in nil. Brilliant!

Your welcome, this was a bit of a XY problem; Ask what you’re looking for directly next time.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.