Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Will not print nor add leaderstat?

Asked by 1 year ago
Edited 1 year ago

Whenever i reach the dedicated amount of money, it will not print nor add the level

Code:


local passId = 106685254 function isAuthenticated(player) return game:GetService("GamePassService"):PlayerHasPass(player, passId) end function Start(plr) print(plr.Name .. " has bought the game pass with id " .. passId) local Player = game.Players.LocalPlayer local Money = Player:WaitForChild('leaderstats'):WaitForChild('Money') script.Parent.MouseButton1Click:Connect(function() Money.Value = Money.Value + 3 end) end game.Players.PlayerAdded:connect(function(plr) if isAuthenticated(plr) then Start(plr) -- activate function end end) local Player = game.Players.LocalPlayer local Money = Player:WaitForChild('leaderstats'):WaitForChild('Money') local Level = Player:WaitForChild('leaderstats'):WaitForChild('Level') script.Parent.MouseButton1Click:Connect(function() Money.Value = Money.Value + 3 end) while true do if Money >= 0 then print("lvl 1") end if Money >= 100 then print("lvl 2") Level.Value = Level.Value + 1 end if Money >= 200 then print("lvl 3") Level.Value = Level.Value + 1 end if Money >= 4100 then print("lvl 4") Level.Value = Level.Value + 1 end if Money >= 800 then print("lvl 5") Level.Value = Level.Value + 1 end if Money >= 1600 then print("lvl 6") Level.Value = Level.Value + 1 end if Money >= 3200 then print("lvl 7") Level.Value = Level.Value + 1 end if Money >= 6400 then print("lvl 8") Level.Value = Level.Value + 1 end if Money >= 12800 then print("lvl 9") Level.Value = Level.Value + 1 end if Money >= 25600 then print("lvl 10") Level.Value = Level.Value + 1 end end

I'm new to coding on roblox so if you see the most disorganized and cluttered code in existence, its because I'm new

0
Change "if Money >=" --> "if Money.Value >=" 9mze 193 — 1y
0
I would convert all the if statements from line 32 to line 70 into a giant if else statement virushunter9 943 — 1y
0
I'll try both of these things, thank you! travis767676 0 — 1y
0
It worked!! Thanks! travis767676 0 — 1y

Answer this question