Can someone please help me fix this, I've tried many things but it's not working;
local p = game:GetService("PlayerPointService") local player = script.Parent.Parent local bankBalance = player.Bank.Value
if bankBalance == 1 then p:AwardPoints(player.userId,45) print("point awarded") while true do wait() bankBalance = 0
if bankBalance == 5 then p:AwardPoints(player.userId,125) print("points awarded") while true do wait() bankBalance = 0
if bankBalance == 10 then p:AwardPoints(player.userId,500) print("points awarded") while true do wait() bankBalance = 0
end end end end end end
Just some misspelling here I've did it for you!
1 | local p = game:GetService( "PlayerPointService" ) local player = script.Parent.Parent local bankBalance = player.Bank.Value |
2 |
3 | if bankBalance = = 1 then p:AwardPoints(player.userId, 45 ) print ( "Points Awarded" ) while true do wait() bankBalance = 0 |
4 |
5 | if bankBalance = = 5 then p:AwardPoints(player.userId, 125 ) print ( "Points Awarded" ) while true do wait() bankBalance = 0 |
6 |
7 | if bankBalance = = 10 then p:AwardPoints(player.userId, 500 ) print ( "Points Awarded" ) while true do wait() bankBalance = 0 |
8 |
9 | end end end end end end |
If this helped +1
Both of you got Line 1 wrong...
1 | local p = game:GetService( "PointsService" ) local player = script.Parent.Parent local bankBalance = player.Bank.Value --PointsService, not PlayerPointService |
2 |
3 | if bankBalance = = 1 then p:AwardPoints(player.userId, 45 ) print ( "Points Awarded" ) while true do wait() bankBalance = 0 |
4 |
5 | if bankBalance = = 5 then p:AwardPoints(player.userId, 125 ) print ( "Points Awarded" ) while true do wait() bankBalance = 0 |
6 |
7 | if bankBalance = = 10 then p:AwardPoints(player.userId, 500 ) print ( "Points Awarded" ) while true do wait() bankBalance = 0 |
8 |
9 | end end end end end end |