|
| 02 Dec 2015 06:50 PM |
local Tycoon = script.Parent.Main:Clone()
function Regenerate() script.Parent.Main:Destroy() wait(1) local NewTycoon = Tycoon:Clone() NewTycoon.Parent = script.Parent NewTycoon:MakeJoints() end
while true do wait(1) local Owner = script.Parent.Main.Owner if Owner.Value ~= "" then if not game.Players:findFirstChild(Owner.Value) then Regenerate() end end end |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2015 06:53 PM |
does not look like it would cause lag but this is better function Regenerate() script.Parent.Main:Destroy() wait(1) local NewTycoon = Tycoon:Clone() NewTycoon.Parent = script.Parent NewTycoon:MakeJoints() end
script.Parent.Main.Owner.Changed:connect(function() wait(1) local Owner = script.Parent.Main.Owner if Owner.Value ~= "" and not game.Players:findFirstChild(Owner.Value) then Regenerate() end end)
http://www.roblox.com/ITS-FREE-item?id=130771265&rbxp=8320118 |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2015 06:55 PM |
| The issue is that the model it's cloning is really big. I want to know how to reduce lag when this process is done. |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2015 06:56 PM |
| I can't make that model any smaller. If there is a possible way to regen it more efficiently... |
|
|
| Report Abuse |
|
|
Bagel4536
|
  |
| Joined: 11 Sep 2014 |
| Total Posts: 40 |
|
|
| 02 Dec 2015 07:16 PM |
| Try splitting the map into a few sections and regenerating it piece by piece. It should reduce the lag |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2015 07:18 PM |
create a new model, and insert the pieces of the tycoon into it 1 by 1
i make u math.sqrt() |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2015 07:18 PM |
| The issue is, I cannot do that, because i'd need to re-write all of the scripts again. If there is no other way except for splitting it up, it's okay. |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2015 08:17 PM |
for _, v in pairs(model:GetChildren()) do v:Clone().Parent = game.Workspace wait(1) end |
|
|
| Report Abuse |
|
|