script.Parent.ClickDetector.MouseClick:Connect(function(player)
print("hay")
end)
This simple Local script doesn't work. No errors, nothing. It's like I'm not clicking at all, but I am.
script.Parent.ClickDetector.MouseClick:Connect(function(player)
print("hay")
end)
This simple Local script doesn't work. No errors, nothing. It's like I'm not clicking at all, but I am.
Here you go. Make sure that this script is NOT a Local Script and is put inside of the ClickDetector which should be inside of the part.
script.Parent.mouseClick:connect(function() -- LUA Script Noticing the click
print("hay") -- Script responding to the click
end)
Hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
ummm why do we do (function(player) instead of (function() i dont get it
HappyTimIsHim it's optional. With Function(player) you can pass player who clicked as an argument to the funtion.
Rinextel if I do that I will not be able to do this which is my main problem script.Parent.MouseClick:Connect(function(player) game:GetService("ReplicatedStorage").RemoteBuy:FireServer() end)
You don't need remote events for that. Whatever code is in the OnServerEvent simply do in the MouseClick
if I do that then exploiters will be able to exploit their Purchases