When I try to make a click detector script. I always get an error, how do I make it work?
Please help!
Here is what I have or what I think:
function onClicked.Clickdetector()
Here is what you do:
function onClicked() --code end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Hi, I recommend reading this small article. It will help your understanding a lot! Please vote this answer up if it helped you, and accept my answer if it works out in the end!
wiki.roblox.com/index.php/Making_an_onClicked_script
You can also do this:
script.Parent.TouchDetector.MouseClick:connect(function() --What you want to happen when clicked end
This is what I do:
ClickDetector = script.Parent ClickDetector.MouseClick:connect(function(CanCollide) workspace.Part.CanCollide = false end
Just so you know, this is just an example.