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.
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)
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?
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.
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.
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.