I'm a little confused. pretty sure I can't use a function in a if statement like I did but I don't know the alternative. basically just trying to print "done" if the part is hovered over by the mouse and clicked. any help would be appreciated
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local function clicked()
mouse.Button1Down:connect(function()
end)
end
mouse.move:connect(function()
if mouse.Target == game.Workspace.Part and clicked() then
print("done")
end
end)

6 comments
How would I be able to script it so that it requires the mouse to be hovering over the part and getting click to print done?
what u mean if you click it then ur hovering over the part but noone the less
https://developer.roblox.com/en-us/api-reference/event/ClickDetector/MouseHoverEnter
use this event to add the click event and then
remove the click event use this event https://developer.roblox.com/en-us/api-reference/event/ClickDetector/MouseHoverEnter but do you understand click dectector, it makes the partent clickable and able to respond to a mouse events ?
my bad i ment to paste this event https://developer.roblox.com/en-us/api-reference/event/ClickDetector/MouseHoverLeave use this even to remove the click event, but still i dont get why u would want to do this