Uzamkiz
(Rush)
#1
Can someone help me? I don’t see any mistakes but it doesn’t seem to be working!
local clicked = false
script.Parent.Money.MouseButton1Click:Connect(function(begin)
local Cash = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Cash")
clicked = true
if clicked then
Cash.Value = Cash.Value + math.Random(1,10000)
clicked = false
wait(86400)
script.Parent.Money.MouseButton1Click:Connect(function()
script.Parent.Visible = false
end)
end
end)
Ioveczour
(Sulo)
#2
Is it a local script or a script?
local clicked = false
script.Parent.Money.MouseButton1Click:Connect(function(begin)
local Cash = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Cash")
clicked = true
if clicked then
Cash.Value = Cash.Value + math.Random(1,10000)
wait(86400)
clicked = false
script.Parent.Money.MouseButton1Click:Connect(function()
script.Parent.Visible = false
end)
end
end)
u used a debounce wrong
Uzamkiz
(Rush)
#4
It is a local script
I am typing this bc this reply needs to be above 30
Can you show the explorer? aaaaaaaaaa
Ioveczour
(Sulo)
#6
If the script only works once, then breaks after, then, the only reason you can’t click it again is because the wait statement is a long time.
Uzamkiz
(Rush)
#8
Yeah its suppose to be like that, its a daily reward
Ioveczour
(Sulo)
#9
So does the script just fail???
Uzamkiz
(Rush)
#10
Yeah but there doesn’t seem to be any errors I am gonna look over it again rq
Ioveczour
(Sulo)
#11
Sometimes MouseButton1Click doesn’t work. Try MouseButton1Down.
Uzamkiz
(Rush)
#12
Thank you its working now!
needs to be over 30
Ioveczour
(Sulo)
#14
What needs to be over 30???
He’s talking about the words limit thingy.
Uzamkiz
(Rush)
#16
My reply’s need to be over 30
eeeeeee
But I’m still surprised mousebutton1click sometimes wont work. I use it all the time and it works just fine.
Ioveczour
(Sulo)
#18
I don’t recommend using wait, because the player can rejoin easily and get award again.
Uzamkiz
(Rush)
#19
Yeah idk I use mousebutton1click most of the time, it was probably a bug or something
Uzamkiz
(Rush)
#20
How would I make it so that won’t happen? I mean like what could I use besides wait to prevent that from happening?
Ioveczour
(Sulo)
#21
You can use datastores and os.time()