How can i call a Clickdetector so the Player did not clicked it but the Clickdetector think it was Clicked?
How can i Call a Mouseclick?
2 answers
No, you can't truly simulate a mouse click. The best you can do is call the function associated with the ClickDetector.
i.e:
function clicked(player)
print(("%s clicked this"):format(tostring(player)))
end
ClickDetector.MouseClick:Connect(clicked) -- When a player clicks on the clickdetector
clicked() -- The closest you can get to simulating a button press at the moment
In the example, the function clicked() is associated with the ClickDetector, so calling the function clicked() could 'simulate' a button press, although it will not send a keypress event.
Greetings, I hope this function answers your question.
Put this script in your ClickDetector in workspace.
script.Parent.MouseClick:Connect(function()
--Whatever goes here will be fired when clicked!
end)
What this function does is give information to the ClickDetector, and fires the code inside of the function.
Making a part Transparent on click:
Make a part and anchor it. Inside the part add a ClickDetector and a script inside.
local part = yourpartlocation
script.Parent.MouseClick:Connect(function()
part.Transparency = 1
end)
I hope this helps! And remember that this isn't a request site, so try this out yourself.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I want to Simulate a Mouseclick i know hot a Clickdetector works