Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

7 comments

0

I fixed the indentation and put the code in a code block.

0

thank u

0

:thumbs_up:

0

You're not upping i at all; i is staying the same. Did you perhaps mean to do i = i + 1 after?

0

I had problems when trying to put that into my code how would u add it?

0

After line 20. :p

0

it shows an error

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.