VexTrexYT
|
  |
| Joined: 20 Dec 2016 |
| Total Posts: 63 |
|
|
| 29 Jul 2017 05:52 PM |
I am creating a game. I update my game every week. I think some servers will stay active for a long time. I know I can shut down a server but is there a script where I can shut down a server. Like after a timer, the server will shutdown.
|
|
|
| Report Abuse |
|
|
Zawie
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 6338 |
|
|
| 29 Jul 2017 05:54 PM |
| just get all the players at once |
|
|
| Report Abuse |
|
|
Zawie
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 6338 |
|
|
| 29 Jul 2017 05:55 PM |
kick*
Player:Kick("Server Shutdown!") |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 07:02 PM |
| You could destroy the NetworkClient, but use :Kick() |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 29 Jul 2017 07:05 PM |
| at the bottom of a serverscript ########### ## ## hours for example print 'warn everyone ur game shutting down' wait(10) -- give more time i guess -- kick everyone |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 07:07 PM |
Use a DataStore to broadcast whether or not the server should shut down, check over the server every couple of minutes, then if true:
for i,v in pairs(game.Players:GetChildren()) do v:Kick("Server shutdown!"); end |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 29 Jul 2017 07:19 PM |
datastore not necessary in any case
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 07:21 PM |
| @wrath for a game-wide shut down (i.e. shutting down all existing servers) it is. Or you could use ########### but you would need a website of your own |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 29 Jul 2017 07:31 PM |
neither one. i can already perform server wide messages/warnings without any of those things
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 08:08 PM |
@Wrath,
Yeah, Datastore is just a whole lot of extra work for nothing
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 08:12 PM |
| DataStore isnt that fast.. just use a website like ######## or something to update that to tell the script to do what u want. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 08:29 PM |
| @Michael if you needed you shutdown every server you could just do it from the website, having a datastore for that would be a waste of time |
|
|
| Report Abuse |
|
|
Briicks
|
  |
| Joined: 03 Apr 2015 |
| Total Posts: 1796 |
|
|
| 29 Jul 2017 08:55 PM |
@people saying not to use datastore, well give op the other ways...
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 08:59 PM |
| There is absolutely nothing wrong with using a data store key. OnUpdate would work absolutely fine. Using ########### solely for this reason is convoluted and unnecessary. |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 29 Jul 2017 09:02 PM |
"Like after a timer, the server will shutdown."
tried to give op another way but filter thwarted me. prob wasn't what he wanted anyway
I have a loop in my game that checks if a certain model was updated using GetProductInfo, so just update a model when you wanna display a static warning. Maybe even customize the warning/message through the description
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 09:10 PM |
| @wrath Then how would a server know when to auto shutdown if the game has been updated without using web calls in DataStoreService or HttpService? |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 09:11 PM |
Wait, I just read the OP. Why are we even discussing this?
local players = game:GetService("Players")
wait(maximumServerTime)
players.PlayerAdded:Connect(function(player) player:Kick() end)
for _, player in pairs(players:GetPlayers()) do player:Kick() end)
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 09:15 PM |
| @Unsub OP says that he updates the game every week, and he wants to be able to shut down all running servers when he makes an update. You cant really do this from a script unless you use some sort of web call. Of course you can always manually "Shut down all running servers" from the roblox game page. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 09:16 PM |
If you want to shut all servers down, with a warning, use a data store key.
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 09:19 PM |
| @unsub that is what i have been saying for a while now lol |
|
|
| Report Abuse |
|
|