I'm new to scripting and I was wondering how I would script a badge to award players when they acquired a certain amount of cash in the game. I know it should use an If statement but I'm not sure how. I was thinking on the lines of
local badgeID = 111111 if player.leaderstats.cash = 100000 do badgeservice:Awardbadge(p.userid, badgeID) endend
If someone could lead me in the right direction that would be great.
stat = "KOs" needed = 5 player = game.Players.LocalPlayer id = 00000 wait() player.leaderstats[stat].changed:connect(function() if player.leaderstats[stat].Value>(needed-1) then game:getService("BadgeService"):AwardBadge(id,player.PlayerId) end end)
should work :)