i have finna been searching how to execute or run a script by using clickdetector but find 0 heck. anyoNE knows hwo to doE?
local ClickDetector = script.Parent ClickDetector.MouseClick:Connect(function() -- code end)
runs on click
You can create a function for your code to be executed when the player clicked the detector. Then let the script listen for the MouseClick property of the clickdetector, and let it fire the function.
This is how your code would be like:
local detector = script.Parent function disIsSupposedtobefired(player) print(player.Name.. ' has clicked the detector') end --you can fire the function like this detector.MouseClick:Connect(disIsSupposedtobefired) -- OR detector.MouseClick:Connect(function(player) disIsSupposedtobefired(player) end)