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

What's wrong with this simple script?

Asked by 8 years ago
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

Log in to vote
6
Answered by
Async_io 908 Moderation Voter
8 years ago

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

0
Nope, still going to the workspace. james24dj 90 — 8y
0
Is it throwing any errors in the console? Async_io 908 — 8y
0
Try, local i = Scrip.Position game.Workspace.Part.Position=Vector3.new(i) Async_io 908 — 8y
0
Yeah, it says 21:47:16.290 - Workspace.Part.Script:6: attempt to index local 'expl' (a boolean value) james24dj 90 — 8y
View all comments (19 more)
0
I Just updated my comment, can you see if everything is right? james24dj 90 — 8y
0
Try. local realexpl = game.Workspace.Part.Explosion realexpl.Positon = Scrip.Position ---? Async_io 908 — 8y
0
Edited my Answer, try that. Async_io 908 — 8y
0
It says Position is not a valid member of Explosion james24dj 90 — 8y
0
My bad! It says "Positon". You spelled Position wrong. I'll test it now. james24dj 90 — 8y
0
I edited my main answer. It worked for me, hope it works for you Async_io 908 — 8y
0
Nope, does not work. james24dj 90 — 8y
0
It worked but.. how come it's STILL exploding the workspace? It's exploding the brick AND workspace now. james24dj 90 — 8y
0
It shouldn't be. Async_io 908 — 8y
0
My bad, forgot a part in the script, it's updated now. Async_io 908 — 8y
0
Mk james24dj 90 — 8y
0
Does it work now? Async_io 908 — 8y
0
Wait, is it because I'm testing in "Test Mode" and not "Server Mode"? james24dj 90 — 8y
0
OMFG IT DOESNT WORK!!! IT KEEPS EXPLODING THE WORKSPACE AT (0, 0, 0) AND THE BRICK AT THE SAME TIME!! This is frustrating! james24dj 90 — 8y
0
Is also works in game. I just tried it out. Async_io 908 — 8y
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. Async_io 908 — 8y
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. james24dj 90 — 8y
0
I give up. Good lord, What in my script does it say -- ANYWHERE -- to put an instance at 0, 0, 0?! james24dj 90 — 8y
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. james24dj 90 — 8y
Ad

Answer this question