So recently I’ve been having a problem where my click detector wasn’t working at all.
The hover mouse icon wasn’t showing and it wasn’t doing what the script was telling it to do.
It was working fine earlier, but now it just seemed to have died.
I did make some changes, and it might be because of that.
local floppa = script.Parent
local ClickDetector = floppa.ClickDetector
local dropperPart = floppa:WaitForChild("dropperPart") -- used to not be here
local replicatedStorage = game:GetService("ReplicatedStorage")
local cash = replicatedStorage:WaitForChild("cash")
local canRun = true
ClickDetector.MouseClick:Connect(function()
if canRun == true then
local newCash = cash:Clone()
local dropperPosition = dropperPart.Position -- dropper position was floppaPosition, dropper part was just floppa.
local cashPosition = dropperPosition -- dropper position was floppaPosition and at the end, Vector3.new(0,0,6)
newCash.Position = cashPosition
newCash.Parent = workspace
canRun = false
wait(0.1)
canRun = true
end
end)
The parts highlighted used to not exist.
I’ve tried restarting Roblox studio, putting another brick into the game, and re-adding the click detector.
It seems to only work in new games.
Try putting a print statement throught to find where its breaking. Cause it looks fine to me. I think maybe the new part is getting in the way of the click detector. Try shrinking the new part very very small
try using WaitForChild("ClickDetector"), which yields the script until the instance is found
if the cursor doesn’t show up, try restarting studio (had this issue months ago)
I just realised, it happends EVERY SINGLE TIME I CREATE A GAME. its not only just that game.
ive also tried uninstalling and re-insatlling roblox studio.