I was making a mouse target script where you click and it instance a explosion and it gets the position of the mouse.I'm not sure why it isnt working..
ex = Instance.new("Explosion")
ex.Position = mouse.Target.Position
I was making a mouse target script where you click and it instance a explosion and it gets the position of the mouse.I'm not sure why it isnt working..
ex = Instance.new("Explosion")
ex.Position = mouse.Target.Position
There is nothing telling the game to fire this script when the mouse is clicked and the explosions parent is nil. Try this.
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Button1Down:connect(function()
local e = Instance.new("Explosion")
e.Parent = game.Workspace
e.BlastPressure = 10 -- Edit this according to your needs.
e.BlastRadius = 10 -- Edit this according to your needs, as well.
e.Position = mouse.hit -- This will place the explosion at your mouse.
end
end)
It spawned the explosion but it didnt spawn where the position of the mouse was.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Let me know if the answer helped you?