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

My script's Text isn't being raised by 1 each second? The one with three stars around it

Asked by 5 years ago
Edited 5 years ago

Why isnt my script raising the Text by one each time it gives them money/view the line with the stars is what I need help with. The stars were there as a highlighter

local i = 1
local price = 1
local y = math.random(10)
local dep = script.Parent.Parent
local player = game.Players.LocalPlayer
local stats = player:WaitForChild("leaderstats")
local z = 1 + stats.Subscribers.Value

function click()
    if script.Parent.Visible == true then
        script.Parent.Parent.Cav.Visible = false
        dep.micro.Visible = false
        dep.online.Visible = false
        dep.fpc.Visible = false
        dep.bill.Visible = false
        dep.sap.Visible = true
        script.Parent.Parent.Parent.Parent.pot.Visible = true
        for _ = 1,5 do
            stats.Views.Value = stats.Views.Value + 1
            ***script.Parent.Parent.Parent.Parent.pot.Text = "Views:".. i + 1***
            wait(1)
        end
    end
end

script.Parent.MouseButton1Click:Connect(click)
0
I fixed the indentation and put the code in a code block. TheeDeathCaster 2368 — 5y
0
thank u Zeppelin0330 38 — 5y
0
:thumbs_up: TheeDeathCaster 2368 — 5y
0
You're not upping `i` at all; `i` is staying the same. Did you perhaps mean to do `i = i + 1` after? TheeDeathCaster 2368 — 5y
View all comments (3 more)
0
I had problems when trying to put that into my code how would u add it? Zeppelin0330 38 — 5y
0
After line 20. :p TheeDeathCaster 2368 — 5y
0
it shows an error Zeppelin0330 38 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Ad

Answer this question