I want to make it so the player gets cash every 0.5 seconds
When I join, I get the cash value once
game.Players.PlayerAdded:Connect(function(plr)
local x = require(game.ReplicatedStorage.EternityNum)
local s = plr:WaitForChild("Stats")
local m = plr.Stats:FindFirstChild("Money")
local mu = plr.Stats:FindFirstChild("Multi")
while wait(0.5) do
local svb = x.convert(mu.Value)
local val = x.convert(1)
local val = x.mul(val, (x.add(x.mul(x.convert(mu.Value),{1,0}),{1,0})))
svb = x.add(svb,val)
m.Value = x.bnumtostr(svb)
end
end)
check the output, maybe the s variable is an infinite yield, preventing everything else from running. Did you spell “Stats” as you spelt it elsewhere?
Its having no problem getting the stats, the problem is its not repeating the math so for this example, I should be getting 3 money every 0.5 seconds, but I only get 3 money