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

why isn't my instance.new for an explosion working?

Asked by 4 years ago

I had a script where it would wait a little under 3 minutes, and then explode. However, said script is broke, and I don't see what's wrong with it.

wait(160)
local x = Instance.new("Explosion")
x.Position = script.Parent.Position
x.BlastRadius = 100
x.BlastPressure = 10000000000000000000

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

What you have done wrong is that when an instance is created, its first parent is nil(nothing), you need to set a parent for it and it should work just as perfect.

server script tho!

wait(160) -- 3 mins :o
local x = Instance.new("Explosion")
x.Position = script.Parent.Position
x.BlastRadius = 100
x.BlastPressure = 10000000000000000000
x.Parent = game:GetService("Workspace")
0
you set the parent last, for optimization, not right after yuo create the instance Fad99 286 — 4y
Ad

Answer this question