Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved]Will I need to include a wait before calling functions on objects that I just created?

Asked by 5 years ago
Edited 5 years ago

Here is my code:

        -- this happens when a player leaves the game if they owned a tycoon
        local tycoonName = plrInfo.OwnedTycoon.Value
        local tycoon = game.Workspace.Tycoons:FindFirstChild(tycoonName)

        tycoon:Destroy()

        local tycoonCopy = savedTycoonsTable[tycoon.Name]:Clone()
        local runTycoonDoor = require(moduleScripts.RunTycoonDoor)

        runTycoonDoor(tycoonCopy)
        tycoonCopy.Parent = game.Workspace.Tycoons

Do I need to include a wait in between anything in order to protect it from breaking? Will the function I call to run the tycoon door error ever without a wait? Thanks!

0
This is a different situation than the question I just asked a few minutes earlier. User#21908 42 — 5y
0
If you want it to happen gradually use a wait User#19524 175 — 5y
0
but otherwise? User#21908 42 — 5y
0
don't add a wait then User#19524 175 — 5y
0
ok thanks User#21908 42 — 5y

Answer this question