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

Why won't my IntValue change in the properties tab?

This function should change the value of RedFunds. It does change it in the output, but when I look at the IntValue in the properties tab it still shows its original value.

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local funds = game.Workspace.Info.RedFunds.Value
local tickingIncrease = 1

function fundTick()
	while wait(1) do
		funds = funds + tickingIncrease
		print(funds)
	end
end

function main()
	fundTick()
end

main()

1 answer

✓ Accepted answer

###This is because of line 3. You’re setting the variable to the Value of your IntValue at the time of assigning the variable. For example, if the value at assignment was 60, local funds = game.Workspace.Info.RedFunds.Value would be the same as

local funds = 60

###To fix this, remove the .Value.

local funds = game.Workspace.Info.RedFunds

###And on line 8, add the .Value.

funds.Value = funds.Value + tickingIncrease

1 comment

0

Awesome, thanks!

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