Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Cash to Collect button Not claiming cash?

Asked by 4 years ago

Hey there, I have an issue with my cash to collect button. There is not errors.

Here is the script:

01while wait(.3) do
02    script.Parent.BillboardGui.TextLabel.Text = "Cash to collect : $"..tostring(script.Parent.Parent.Parent.CashToCollect.Value)
03end
04 
05script.Parent.Touched:Connect(function(Hit)
06    local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
07    if Player then
08        local Human = Hit.Parent:FindFirstChild("Humanoid")
09        if Human then
10            if Hit.Parent.Humanoid.Health >= 1 then
11                if Player and Player == script.Parent.Parent.Parent.Owner.Value then
12                    local Money = script.Parent.Parent.Parent.Owner.Value:FindFirstChild("leaderstats"):FindFirstChild("Cash")
13                    if Money then
14                        Money.Value = Money.Value + script.Parent.Parent.Parent.CashToCollect.Value
15                        script.Parent.Parent.Parent.CashToCollect.Value = 0
View all 21 lines...
0
Because your loop is holding the thread. Ziffixture 6913 — 4y
0
Ok. NillaTheCat12345 14 — 4y

Answer this question