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

My part is deleting itself! Please help?

Asked by 9 years ago

As the title says. I really need help. Here's the code.

    wait(5)
Instance.new("Part", game.Workspace).Name = "Bob"
    wait(5)
    game.Workspace.Bob.Transparency = 1
    wait(5)
while game.Workspace.Bob.Transparency == 1 do
    wait(0)
    Instance.new("Part", game.Workspace)
end

EDIT: When i'm on a "Baseplate" world the script works but if i'm on a "Flat Terrain" world it doesn't. but i still need help..

0
You sure it just isn't somewhere you can see? I don't see any instance of removal in your script yogipanda123 120 — 9y
0
I know but on my other Baseplate world it works. But not on a Flat terrain world. When i look in the "Explorer" i see "Bob" is spawning but then like after 5 sec or 2 sec it gets nil or something... xxXPotatoeXxx 0 — 9y
0
Is that some kind of spam script? The script would only create a TON of new Parts once Bob's Transparency reaches 1, and there's nothing to change the value again. Also, the wait is 0, which is extremely low, and would probably crash RbxStudio... TheArmoredReaper 173 — 9y
0
Okay, and yes it's a spam script and the script worked on a BasePlate before and it didn't cause and lag for me xxXPotatoeXxx 0 — 9y

1 answer

Log in to vote
1
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

Your problem with terrain is that it is elevated differently. When you instance the new part, it spawns inside the terrain and may be shot out from it and destroyed. To solve that, set the position of the part above the terrain.

0
Okay thanks! xxXPotatoeXxx 0 — 9y
Ad

Answer this question