This is the code:
` game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new(“Folder”)
leaderstats.Name = “leaderstats”
money = Instance.new("IntValue")
money.Name = "Money"
money.Parent = leaderstats
money.Value = 0
---------------------------------------------------------------------
multiplier = Instance.new("IntValue")
multiplier.Name = "Multiplier"
multiplier.Parent = player
multiplier.Value = 1.0
---------------------------------------------------------------------
leaderstats.Parent = player
end) :
workspace:WaitForChild(“Upgrades”):WaitForChild(“Upgrade_1”):WaitForChild(“ClickDetector”).MouseClick:Connect(function(player)
workspace:WaitForChild(“Upgrades”):WaitForChild(“Upgrade_1”):WaitForChild(“ClickDetector”):Destroy() — Removes ClickDetector
local money = player:WaitForChild(“leaderstats”):WaitForChild(“Money”)
——————————————————————— ———————————————————————
while True wait(0.025) do
local currentMultiplier = player:WaitForChild(“Multiplier”).Value
money.Value = money.Value + (1.0 * currentMultiplier)
end
end) `
The problem is that when I change the multiplier.value in the Roblox studio it doesn’t change change in the code. However, when I change it in the code it works fine. I don’t know how to get the code to update when I change the variable manually in the Roblox studio.
One of my theories is that the money.Value is not checking if the variable changed whilst the loop is running. This could very well be wrong though. I am new to programming.
user25691031 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.