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

What's wrong with this simple script?

script.Parent.Touched:connect(function()
	script.Parent:FindFirstChild("Humanoid")
    local Scrip = script.Parent
    Instance.new("Explosion", game.Workspace.Part)
    local Explosion = game.Workspace.Part.Explosion
    game.Workspace.Part.Explosion.Position = Scrip.Position
end)


How come the position isn't in the script's Parent's position? It just does into workspace. And I don't see any CratersAndDebris when it explodes neither. Can you help?

1 answer

Try this

script.Parent.Touched:connect(function()
  local Scrip = script.Parent
Instance.new("Explosion", game.Workspace.Part)
local Explosion = game.Workspace.Part.Explosion
game.Workspace.Part.Explosion.Position = Scrip.Position
end)

Worked for me

Best of Luck

23 comments

0

Nope, still going to the workspace.

0

Is it throwing any errors in the console?

0

Try, local i = Scrip.Position game.Workspace.Part.Position=Vector3.new(i)

0

Yeah, it says 21:47:16.290 - Workspace.Part.Script:6: attempt to index local 'expl' (a boolean value)

0

I Just updated my comment, can you see if everything is right?

0

Try. local realexpl = game.Workspace.Part.Explosion realexpl.Positon = Scrip.Position ---?

0

Edited my Answer, try that.

0

It says Position is not a valid member of Explosion

0

My bad! It says "Positon". You spelled Position wrong. I'll test it now.

0

I edited my main answer. It worked for me, hope it works for you

0

Nope, does not work.

0

It worked but.. how come it's STILL exploding the workspace? It's exploding the brick AND workspace now.

0

It shouldn't be.

0

My bad, forgot a part in the script, it's updated now.

0

Mk

0

Does it work now?

0

Wait, is it because I'm testing in "Test Mode" and not "Server Mode"?

0

OMFG IT DOESNT WORK!!! IT KEEPS EXPLODING THE WORKSPACE AT (0, 0, 0) AND THE BRICK AT THE SAME TIME!! This is frustrating!

0

Is also works in game. I just tried it out.

0

It's on your side, post your script. Everything is working for me, it's exploding and killing me right where the brick is.

0

My God, I'm gonna update my comment to show you what I have. I just don't understand why the server is putting an explosion instance into Workspace.

0

I give up. Good lord, What in my script does it say -- ANYWHERE -- to put an instance at 0, 0, 0?!

1

Ok! I think I'm seeing something! When I FIRST touch the brick, ONLY THE BRICK explodes and kills me, any other time in that server/game, the workspace explodes with it.

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