So I made an explosion script based off of a dialog choice..
Dialog=script.Parent Dialog.DialogChoiceSelected:connect(function(Player, Choice) if Choice == Dialog.DialogChoice1.DialogChoice2.DialogChoice3 then local bomb = Instance.new("Explosion",game.Workspace) bomb.Position = game.Workspace.Player.Torso end end)
so why doesn't it work? Instead of blowing up the my torso, it just goes in some other spot in the map..
You need to set the position to the torso's position, for example:
If we use the player returned from DialogChoiceSelected
we know which Player
chose the dialog, we can then get the Character
from the Player
and position the Explosion
to the Character's Torso.
bomb.Position = player.Character.Torso.Position
Dialog=script.Parent Dialog.DialogChoiceSelected:connect(function(Player, Choice) if Choice == Dialog.DialogChoice1.DialogChoice2.DialogChoice3 then local bomb = Instance.new("Explosion",game.Workspace) bomb.Position = game.Workspace.Player.Torso.Position end end)