- What do you want to achieve?
I want the value of incoming income to change when the signal is stronger and repeat filling on to the income. but I can’t find a way for the script to detect when the signal is stronger whilst repeating the income. Ive tried doing the “Repeat until” with “if statments” inside but the script continues with the same income regardless if the signal is changed.
Signal:
local Parent = script.Parent
local Start = Parent.Start
local Signals = {
Weak = Parent.NumberImage.Signals.Signal2,
Mid = Parent.NumberImage.Signals.Signal3,
Strong = Parent.NumberImage.Signals.Signal4
}
local Upgrades = Parent.Upgrades
local IncomeValue = Parent.NumberImage.IncomeDisplay.Available
local LastRate = Parent.NumberImage.RateNum.LastRate
-- Out Of workspace
local ReplicatedStorage = game.ReplicatedStorage
-- Other
Start.MouseButton1Click:Connect(function()
if Upgrades.Entry.Value == true then -- Entry meaning lvl 1
print("Starting Money")
repeat
local EntryIncome = math.random(0,10)/10
IncomeValue.Value += EntryIncome
LastRate.Value = EntryIncome
until Start["On/Off"].Value == false
end
end)