|
basically kicks all players and prevents people from joining
"If you are good at something, never do it for free." - The Joker |
|
|
Ever heard of a feature you can do from the game page called "Shut Down All Instances"? |
|
|
Ever heard of scripting?
"If you are good at something, never do it for free." - The Joker |
|
|
|
@Scott
yes
"If you are good at something, never do it for free." - The Joker |
|
|
Why would you need to do that if u dont want people to play then just make the game inactive and if you really want it that bad then just make a script that kicks all players and btw you cannot prevent players from joining that server because once all players are gone the server is destroyed and roblox will just make another server once it needs another one so I do not support this one it just doesn't make sense |
|
|
Sharp you obviously don't understand.
The owner might not be online and its good to handle all problems gracefully (ever heard of exception handling? Yeah. It's called 'catch' in most languages and 'else' and 'elseif' in lua.
//cpmody\\ i am a windows operating system confirmed // |
|
|
Also, I might have a workaround for this suggestion...
-- if boolean, use this code
if SHUTDOWN_BOOL == true then
repeat
local players = game.Players:GetPlayers()
for i=1, #players do
local currentplayer = players[i]
currentplayer:Kick()
end
until
game.Players.NumPlayers == 0
end
//cpmody\\ i am a windows operating system confirmed // |
|
|
And if its an event remove the final end, and the if statement, and add:
game.Workspace.ShutdownEvent.Event:connect(function() [[assuming the BindableEvent is in Workspace]]
-- code here
end)
//cpmody\\ i am a windows operating system confirmed // |
|
|
Uh...
function shutdown()
for _,plr in next, game.Players:GetPlayers() do
plr:Kick("This game has been shutdown.")
end
shutdown = true
end
game.Players.PlayerAdded:connect(function(plr)
if shutdown then
plr:Kick("This game has been shutdown.")
end
end)
is a solution, but I don't want to put that in /every/ script.
"If you are good at something, never do it for free." - The Joker |
|
|
you don't put it in every script....
only the one. |
|
|
^
damn i hope i dont get ninja'd by op doe
//cpmody\\ i am a windows operating system confirmed // |
|
|
Also cpmoderator, Lua uses something called pcall, not elseif/else for exceptions
local success, errormessage = pcall(function()
-- Do code here, if it errors, it won't break the script.
end)
if not success then
print(errormessage)
shutdown()
end |
|
|
Yes I've heard of scripting. Also, how would you be able to shut down a running server in studio? I mean there's no way to edit a certain server in studio I think. Unless roblox adds a feature to view a certain running server, then this feature wouldn't work. |
|