|
| 21 Aug 2016 10:11 AM |
ok, i am building a tycoon and have this regen script:
local newMain = script.Parent.Main:Clone()
script.Parent.Main.Owner.Changed:connect(function() while true do wait() local owner = game.Players:FindFirstChild(script.Parent.Main.Owner.Value) if owner == nil then script.Parent.Main:Remove() MainClone = newMain:Clone() MainClone.Parent = script.Parent MainClone:MakeJoints() script.Disabled = true wait(0.1) script.Disabled = false break end end end)
But when the user leaves, the tycoon regens, but the new owner of the tycoon that joins is unable to buy any upgrades, and the buttons become unresponsive. The players then have to start a new server to be able to play the tycoon.
Can anybody help me? |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 10:18 AM |
script.Disabled = true wait(0.1) script.Disabled = false
If the script is disabled it won't execute any more code.
Matthew: "Scripting for ROBLOX intelligence? There is no intelligence in ROBLOX." Me: "LOL" |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 10:32 AM |
So i should delete those three lines of code?
|
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 10:54 AM |
| So, i removed that section, but then the tycoon just doesnt regen??? |
|
|
| Report Abuse |
|
|