acecateer
|
  |
| Joined: 05 Nov 2011 |
| Total Posts: 128 |
|
|
| 19 Jun 2014 12:57 PM |
So I'm trying to make it so that when PlaceVersion changes after I enforce an update, it will shutdown all the servers without me having to press shutdown and everyone wondering what just happened. But this script does not seem to work, Game.PlaceVersion.Changed:connect(update) does not work.
//SCRIPT
script.placeversion.Value = game.PlaceVersion print(script.placeversion.Value)
function update() wait() print("The CURRENT Version is "..game.PlaceVersion) print("The OLD Version is "..script.placeversion.Value) if Game.PlaceVersion > script.placeversion.Value then print("Got past the if statement") Game.Workspace.Main.Disabled = true Game.Workspace.RecreateMain.Disabled = true Game.Lighting.Alert.Value = "Updates were found; the server will now shutdown to enforce them." wait(3) Game.Lighting.Alert.Value = "Check the description to see what's new!" wait(3) for i = 1,5 do wait(1) Game.Lighting.Alert.Value = "Shutting down in about "..5-i.." Seconds." end wait(0.8) for a,c in ipairs(Game.Players:GetChildren()) do wait() c:Kick() end end end
Game.PlaceVersion.Changed:connect(update) |
|
|
| Report Abuse |
|
|
acecateer
|
  |
| Joined: 05 Nov 2011 |
| Total Posts: 128 |
|
|
| 19 Jun 2014 01:03 PM |
*Puts post in a rocket and shoots it back to the top of the forums* Bump |
|
|
| Report Abuse |
|
|
acecateer
|
  |
| Joined: 05 Nov 2011 |
| Total Posts: 128 |
|
| |
|
acecateer
|
  |
| Joined: 05 Nov 2011 |
| Total Posts: 128 |
|
|
| 19 Jun 2014 01:26 PM |
| 1 more bump............................. |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 19 Jun 2014 01:33 PM |
Whilst I've not read through your script, the main issue with it is how you're using the Changed event. The event is used on instances and _NOT_ their properties directly.
game.Changed:connect(function(NameOfPropertyThatChanged) end)
For example, |
|
|
| Report Abuse |
|
|
Reqkt
|
  |
| Joined: 17 Jun 2014 |
| Total Posts: 210 |
|
|
| 19 Jun 2014 01:34 PM |
PlaceVersion is a property, not an Instance or table. attempt to index field 'PlaceVersion' (a number value)
game.Changed:connect(function(prop) if (prop == 'PlaceVersion') then -- code end end) |
|
|
| Report Abuse |
|
|
Reqkt
|
  |
| Joined: 17 Jun 2014 |
| Total Posts: 210 |
|
|
| 19 Jun 2014 01:37 PM |
One more thing: updates don't change the PlaceVersion in servers that are already started before the update. |
|
|
| Report Abuse |
|
|