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

Player Point Help?

Asked by 10 years ago

So I made this script, it worked one time this morning, but now it is not working. Basically when you touch the part, it gives you a single player point. It doesnt award player points. All it does is print the of the plr and the players bodypart that touched it.

debounce=false
script.Parent.Touched:connect(function(hit)
    print(hit.Name)
    plr=game.Players:GetPlayerFromCharacter(hit.Parent)


    if plr then
        print(plr.Name)
        if debounce==true then


elseif debounce==false then 
        debounce=true
    local PointsService = Game:GetService("PointsService")

    local pointsToAward = PointsService:GetAwardablePoints()

    local universeBalance = PointsService:GetGamePointBalance(plr.userId)

    if ( pointsToAward < 0 and universebalace == 0) then
        print("No Points left") 
    elseif ( pointsToAward > 0 and universeBalance == 0) then

        pcall(function()
            PointsService:AwardPoints(plr.userId, 1)
        end)
    end

    wait(5)
    debounce=true
    end
    end
    end)

1 answer

Log in to vote
0
Answered by
wrenzh 65
10 years ago

if ( pointsToAward < 0 and universebalace == 0) on line 20 should be if ( pointsToAward < 0 and universeBalance == 0)

0
O thats probably bad Tempestatem 884 — 10y
Ad

Answer this question