Sonic1

Untitled

May 19th, 2016
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. local model = script.Parent
  2. while not script.Parent:FindFirstChild("Version") do wait(0) end;
  3. local modelVersion = model.Version.Value;
  4. local modelID =101162597 -- Change this to the model id of the model you created earlier
  5.  
  6. function checkForUpdate()
  7. -- Get the newest version of the model from the catalog
  8. local newModel = game:GetService("InsertService"):LoadAsset(101162597)
  9.  
  10. -- If the catalog model is newer than the one in game
  11. if newModel and newModel:FindFirstChild("Version") and newModel.Version:IsA("IntValue") and newModel.Version.Value > modelVersion then
  12. -- Replace it
  13. newModel.Parent = model.Parent
  14. model:Destroy()
  15. end
  16. end
  17.  
  18. -- Once the asset is loaded into the ROBLOX cache, it will always be the same. Only call this once.
  19. checkForUpdate()
Advertisement
Add Comment
Please, Sign In to add comment