Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

MouseTarget problem?

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

1 comment

0

Let me know if the answer helped you?

1 answer

✓ Accepted answer

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)

1 comment

0

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.