I currently have a model which when clicked on gives you 30 money in your player stats how can i make it so that after being clicked and having earnt the money, you are not able to click it again?
I have a Click Detector inside my model And here is the script:
function OnClick()
local players = game.Players:GetPlayers()
for i=1,#players do
if (players[i]:FindFirstChild("leaderstats") ~= nil) then
local clicks = players[i]:FindFirstChild("leaderstats")["Money"]
if (clicks ~= nil) then
clicks.Value = clicks.Value + 30
end
end
end
local f = Instance.new("Fire")
f.Parent = script.Parent.Head
game.Debris:AddItem(f, .2)
end
script.Parent.ClickDetector.MouseClick:connect(OnClick)
"If anyone can help me make it so that you can only click the model once It would be greatly appreciated"

1 comment
I think you might be able to disable the click detector or script after you clicked on it?