In this script a part will follow the mouse, I just want to know how you would use a Union from the lighting instead of a part, thanks.
tool = script.Parent
function onButton1Down(mouse)
local target = mouse.Target
local q = Instance.new("Part", Workspace)
q.Size = Vector3.new(3,3,3)
q.Anchored = true
q.CanCollide = False
while true do
wait()
q.CFrame = CFrame.new(Vector3.new(tool.Parent.Humanoid.TargetPoint.X,0,tool.Parent.Humanoid.TargetPoint.Z))
end
end
function onEquipped(mouse)
mouse.Button1Down:connect(function () onButton1Down(mouse) end)
end
tool.Equipped:connect(onEquipped)
(Apologies if I have tagged wrong/incorrectly)

11 comments
I will.
Wow, thanks!
No problem, good luck with your script!
One problem, though, every time you click it clones it. Any Help?
add a local bool variable named Spawned and set it to false. Then when you click check if spawned is false otherwise return.
I have never worked with bool variables, if you want to write it out, that would be great, otherwise, i'll just post it as a new question, thanks!
I've editted my post with a full script you can use.
Question, what if the tool is not equipped, or if the player respawns? The part would still remain, correct?
Using my script?
Wow, thanks a lot damagex!
You're welcome, but take note of Spongocardo's comment above. You will probably need some more code to hande respawns and unequips.