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

How to make an explosion in a player's torso? [DETAILS IN DESC.]

Asked by 8 years ago

I was going to make a script that, when a player joined, a ClickDetector would be spawned into their torso and when clicked, it would EXPLODE!!! >:D Only problem is, idk how. ;( A person named funzrey told me to make a LocalScript in StarterPack, but I'm a bit confused as to how the code would go. Can someone help me? Thanks! :D I WIL BL0W U UP NUB!

0
#NubSpeak RadiantSolarium 35 — 8y

2 answers

Log in to vote
0
Answered by
funzrey 58
8 years ago

You'll need to place a LocalScript in StarterPack with this code

player = game.Players.LocalPlayer
click = Instance.new("ClickDetector", player.Character.Torso)
click.MouseButton1Click:connect(function()
    local explosion = Instance.new("Explosion", player.Character.Torso)
end)

If I have any errors, sorry.

Ad
Log in to vote
1
Answered by 8 years ago

This is basically @funzreys, but I did fixed a few things, I added a ) to then end on line 5 because that would give an error, and I changed to function as that was wrong and giving an error too.

player = game.Players.LocalPlayer
click = Instance.new("ClickDetector", player.Character.Torso)
function onClicked()
    explosion = Instance.new("Explosion", player.Character.Torso)
end
 player.Character.Torso.ClickDetector.MouseClick:connect(onClicked)

Hope this helps :D

0
Good answer, I fixed mine with those fixes, I +1'd you to be fair with the answer funzrey 58 — 8y
0
Thanks, good answer aswell :D pluginfactory 463 — 8y

Answer this question