Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i get an instance to occur at a part in game.workspace?

I've recently learned how to get instances to spawn but what I want to know is how do I get an instance to occur at a part that's in workspace. I wanted my script to send the new instance to occur at its parent which is a part the instance I was using is an explosion this is what I tried

local run=true

	while run do

		E=Instance.new("Explosion",game.workspace.Explosive)

			wait(4)

				end

Explosive is "Explosion's" parent which is a part so I thought if I transferred the child to the part it would send it there but when I tried it still just made an explosion in the center of the world how can I make it explode at its parent instead of the center of the world. Thanks

3 comments

0

Please use code blocks. Not using them will make about 95% of us not want to help you.

0

sorry about that idk why it was blocking the code.

0

Read my bio.

1 answer

✓ Accepted answer

all you have to do is set the position after parenting it

local run = true
while run do
	E=Instance.new("Explosion", workspace.Explosive) -- workspace is a shortcut to game.Workspace
	E.Position = workspace.Explosive.Position -- will not work if "Explosive" is a model
	wait(4)
end

1 comment

0

thx

This discussion is preserved as it was. New answers, comments, and votes are closed.