Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local model = script.Parent
- while not script.Parent:FindFirstChild("Version") do wait(0) end;
- local modelVersion = model.Version.Value;
- local modelID =101162597 -- Change this to the model id of the model you created earlier
- function checkForUpdate()
- -- Get the newest version of the model from the catalog
- local newModel = game:GetService("InsertService"):LoadAsset(101162597)
- -- If the catalog model is newer than the one in game
- if newModel and newModel:FindFirstChild("Version") and newModel.Version:IsA("IntValue") and newModel.Version.Value > modelVersion then
- -- Replace it
- newModel.Parent = model.Parent
- model:Destroy()
- end
- end
- -- Once the asset is loaded into the ROBLOX cache, it will always be the same. Only call this once.
- checkForUpdate()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement