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!
✓ ANSWER ACCEPTED
How to make an explosion in a player's torso? [DETAILS IN DESC.]
2 answers
✓ Accepted answer
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.
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
2 comments
0
Good answer, I fixed mine with those fixes, I +1'd you to be fair with the answer
0
Thanks, good answer aswell :D
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
#NubSpeak