|
| 19 Oct 2015 04:59 PM |
| So I want a script that'll shut down servers after they've been running for 8 hours so it'll reduce lag, any suggestions? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
| 19 Oct 2015 05:12 PM |
| Umm make the script wait 8hrs then kick all the players from the server it's pretty obvious |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 05:20 PM |
| as ever so helpful as it is, I still need to know how to script in the kick all players part as well as time limit? |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 05:23 PM |
for i, v in pairs(game.Players:GetChildren()) do v:kick() end |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 05:24 PM |
| you could also use :ClearChildren() but it probably wouldn't kick the players instantly, unlike :kick() |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Oct 2015 05:25 PM |
wait(60*60*60*8) for X, plr in ipairs(game.Players:GetPlayers()) do plr:Kick("Server has shutdown") end |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 05:25 PM |
| Oh, thanks for the info. Do you know how to set it on a time limit? |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 05:27 PM |
| @sharp: cool i didn't know you can change the message it displays when you kick a player lol |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 05:29 PM |
also the amount of seconds in 8 hours is 28800 so you would do use
wait(28800) --code to kick players |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 05:29 PM |
Thanks again for the help guys, it's much appreciated. Btw I'd add the script into player right? |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 05:30 PM |
| no, just add it to the workspace or wherever you store your scripts |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2015 05:31 PM |
| Yea the wait() command is the time limit the script waits the amount of seconds in 8 hours and then it kicks all the players |
|
|
| Report Abuse |
|
|