I made this script to print how many player points someone has when they touch it and it doesn't work. I've looked over the wiki page and I'm using everything they use, but it's just not working.
PS = Game:GetService("PointsService") script.Parent.Touched:connect(function(pl) if pl.Parent:GetPlayerFromCharacter().Parent:IsFriendsWith(30125279) then Total = Ps:GetGamePointBalance(pl.Parent:GetPlayerFromCharacter().Parent.userID) if Total >= 100 then print(pl.Parent.name.."has"..Total.."points. Good job!") else print(pl.Parent.name.."has"..Total.."points. Try harder."
I don't really like the layout of your script, so I'll rewrite it, and tell me if it works.
local pointsService = game:GetService("PointsService") script.Parent.Touched:connect(function(part) local player = game.Players:FindFirstChild(part.Parent.Name) if player then local pointBalance = pointsService:GetGamePointBalance(player.userId) print(player.Name.." has "..pointBalance.." points. "..pointBalance >= 100 and "Good job!" else and "Try harder.") --I used ternary operators here so that there would be only one print, I know it's more code, but you could have use for it in the future. I just thought it could spice things up. end end)