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!
You'll need to place a LocalScript in StarterPack with this code
1 | player = game.Players.LocalPlayer |
2 | click = Instance.new( "ClickDetector" , player.Character.Torso) |
3 | click.MouseButton 1 Click:connect( function () |
4 | local explosion = Instance.new( "Explosion" , player.Character.Torso) |
5 | 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.
1 | player = game.Players.LocalPlayer |
2 | click = Instance.new( "ClickDetector" , player.Character.Torso) |
3 | function onClicked() |
4 | explosion = Instance.new( "Explosion" , player.Character.Torso) |
5 | end |
6 | player.Character.Torso.ClickDetector.MouseClick:connect(onClicked) |
Hope this helps :D