Here's the code;
local plr = game.Players.LocalPlayer
local Gold = plr:WaitForChild('PlrStats').Gold
local GoldText = script.Parent:WaitForChild('Extras').GoldAmount
local Earn = script.Parent:WaitForChild('Extras').GoldAmount.Earn
local AOP = game.ReplicatedStorage:WaitForChild('AmountOfPlayers')
print('variables')
wait()
AOP.Changed:Connect(function()
print('2 players joined')
if AOP.Value == 2 then
while true do
print('Giving Gold')
wait(1)
Gold.Value = Gold.Value + Earn.Value
end
end
end)
Gold.Changed:Connect(function()
GoldText.Text = 'Gold: '..Gold.Value
end)
Some info;
This is a LocalScript inside ScreenGui Inside Frame. No FE (FilteringEnabled) No errors in output or F9 in game.
any feedback, help, and support are appreciated.
