|
| 24 Nov 2013 01:28 AM |
local v = script.Parent.version while true do wait(30) if script.Parent.pack.update.version.Value > v.Value then wait(3) print("updating") script.Parent.pack.update.main.Disabled = false else wait(3) print("Outdated, now removing!") table.foreach(script.Parent.pack:GetChildren(), function(i,v) v:Remove() end) end end
-----------------------------
This has really stumped me..
It's most likely be a obvious answer,
It updates just fine, but when its done updating (and goes to "Outdated, now removing!") it keeps at it and does not find the update
It works by seeing if the new version is higher then the current one, then updates and sets the original version to the new version (The problem isnt here)
Sorry for messy scripting, i'm very not organized.
The script that inserts the update is 10 seconds earlier then this one, this is the script:
while true do wait(20) local m = game:service("InsertService"):LoadAsset(136391854) m.Parent = script.Parent.pack m.Name = "update" end
In the final product it wont be as often, but just for now since i'm testing.
Help please?
|
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Nov 2013 02:05 AM |
| local v must be inside the loop or else when you remove it using the loop then that value is set to nil. |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2013 02:09 AM |
plus maybe if you explain more about the vars you used like table.forsearch, you'll get more help if you could explain us every variables you use and what it suppose to do.
even tho some are not advance in scripting, they might find logical error if get proper explanation. |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2013 02:12 AM |
The local v solution is not working.
i'm batman |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2013 02:14 AM |
| Update v.Value with the new update version? |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2013 02:16 AM |
@Dennis
Yes it does that already. It's not realizing there's a new update available. I updated the model with a new -higher- version and it's not working.
i'm batman |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Nov 2013 12:08 PM |
Here's the update that the model is getting:
wait(1) print("connection established") msg = Instance.new("Hint", Workspace) msg.Text = "PATCH v"..script.Parent.version.Value.." is now installing on this server! Lag may occur!" game.Workspace.set:remove() game.Workspace.patchservice.version.Value = script.Parent.version.Value wait(3) print("done update") msg:Destroy() script.Parent:remove()
i'm batman |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2013 12:12 PM |
script.Parent.pack.update.version.Changed:connect(function() --Stuff end) |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2013 12:13 PM |
Ah! Thanks! Let's hope it works. :)
i'm batman |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2013 12:32 PM |
I don't see how I can make it work with that method, is there any other methods.
i'm batman |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 26 Nov 2013 05:56 PM |
.
~ Make more Windows phones you scrubs! ~ |
|
|
| Report Abuse |
|
|