generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Problems with PlaceVersion (Property)

Previous Thread :: Next Thread 
acecateer is not online. 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 is not online. 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 is not online. acecateer
Joined: 05 Nov 2011
Total Posts: 128
19 Jun 2014 01:13 PM
Bump........
Report Abuse
acecateer is not online. acecateer
Joined: 05 Nov 2011
Total Posts: 128
19 Jun 2014 01:26 PM
1 more bump.............................
Report Abuse
DataStore is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image