Heyo, I recently tried to make a script where, upon clicking with a tool, set a flag which little robots would move too. It was at 5am, and I was, and still am, very tired. I'd appreciate help finding what's wrong with it.
`local Player = script.Parent.Parent.Parent local Mouse = Player:GetMouse() local Tool = script.Parent
function click() game.Workspace.Flag.Position = Mouse.Hit.p
end
Tool.Activated:connect(click)
`
If you replace the connect with Mouse.Button1Down:connect(click), it works in studio mode but not in-game regularly, as well. Can't find the mouse it seems.

1 comment
Actually seems to be working now, just needed it to be a localscript in the tool.