When a player step on the button it says this..
'Processing PointsSErvice:AwardPoints response, but response is null. userId = 468978, exception is Forbidden Line 29 stack end'
Then the button breaks..
The last print is 'They need to get their points'
local PointsService = Game:GetService("PointsService") local ting = 0 function onTouched(hit) if ting == 0 then ting = 1 print("It got past the tings") check = hit.Parent:FindFirstChild("Humanoid") if check ~= nil then print("check is not nil") local user = game.Players:GetPlayerFromCharacter(hit.Parent) local stats = user:findFirstChild("leaderstats") local universeBalance = PointsService:GetGamePointBalance(user.userId) if stats ~= nil then print("stats is not nil") local award = stats:findFirstChild("Awarded") print("Found total points awarded") local bought = stats:findFirstChild("Bought") print("Found total points bought") local diference = bought.Value - award.Value print("Found difference") if award.Value < bought.Value then print("They need to get their PlayerPoints") PointsService:AwardPoints(user.userId, diference) print("Awarded points" .. diference) if universeBalance ~= award.Value then print("They are have not got their Points") bought.Value = awarded.Value print("Updated bought value") wait(5) end end ting = 0 print("Ting back to 0") end end end end script.Parent.Touched:connect(onTouched)
You can use this to check if points service is available.
local ps = Game:GetService("PointsService") local pointsToAward local s, pointsToAward = pcall(function() return ps:GetAwardablePoints() end) if s and pointsToAward > 0 then -- There are points available to give. else -- Either there are no more points or the service is unavailable because ROBLOX is updating/fixing. end