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 » Scripters
Home Search
 

Re: How do I make this script not lag my game?

Previous Thread :: Next Thread 
thunder1222 is not online. thunder1222
Joined: 07 Jul 2009
Total Posts: 13803
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
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
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
thunder1222 is not online. thunder1222
Joined: 07 Jul 2009
Total Posts: 13803
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
thunder1222 is not online. thunder1222
Joined: 07 Jul 2009
Total Posts: 13803
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 is not online. 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
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
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
thunder1222 is not online. thunder1222
Joined: 07 Jul 2009
Total Posts: 13803
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
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
02 Dec 2015 08:17 PM
for _, v in pairs(model:GetChildren()) do
v:Clone().Parent = game.Workspace
wait(1)
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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