Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Anyone willing to help?

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

1 comment

0

a) What does "not working mean". b) What have you tried c) Use code formatting (the Lua button). Edit your post to address all of these as soon as possible.

2 answers

Just some misspelling here I've did it for you!

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("Points 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

If this helped +1

Both of you got Line 1 wrong...

local p = game:GetService("PointsService") local player = script.Parent.Parent local bankBalance = player.Bank.Value --PointsService, not PlayerPointService

if bankBalance == 1 then p:AwardPoints(player.userId,45) print("Points 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

This discussion is preserved as it was. New answers, comments, and votes are closed.