game.Players.PlayerAdded:Connect(function(player) repeat wait(1) until game:IsLoaded() local prodVal = player.leaderstats.Production local coinVal = player.leaderstats["Ro-Coin"] local MPS = game:GetService("MarketplaceService") local id = 19564558 while true do if MPS:UserOwnsGamePassAsync(player.UserId, id) or player.Name == "Apples002" or player.Name == "deatnumber61" or player.Name == "Nozazxe" or player.MembershipType == Enum.MembershipType.Premium then wait(2.5) coinVal.Value = coinVal.Value + prodVal.Value else if not MPS:UserOwnsGamePassAsync(player.UserId, id) then wait(5) coinVal.Value = coinVal.Value + prodVal.Value end end end end)
I dont get any error or warning in the output. my game has suddenly stopped working cause of this, can someone help?
Why are you putting that in a while true do loop without any cooldowns? Try while wait() do.
game.Players.PlayerAdded:Connect(function(player) repeat wait(1) until game:IsLoaded() local prodVal = player.leaderstats.Production local coinVal = player.leaderstats["Ro-Coin"] local MPS = game:GetService("MarketplaceService") local id = 19564558 while wait() do if MPS:UserOwnsGamePassAsync(player.UserId, id) or player.Name == "Apples002" or player.Name == "deatnumber61" or player.Name == "Nozazxe" or player.MembershipType == Enum.MembershipType.Premium then wait(2.5) coinVal.Value = coinVal.Value + prodVal.Value else if not MPS:UserOwnsGamePassAsync(player.UserId, id) then wait(5) coinVal.Value = coinVal.Value + prodVal.Value end end end end)
solved this myself by removing the or arguement and making it its own if statement