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

This is forbidden?

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)

5 comments

0

1 of your mistakes are that you wrote :FindFirstChild() method wrong.Make sure the concepts wrote correctly and make sure you remember that Lua is case sensitive.

0

It might be a bit helpful if you helped me with what is wrong with the script... The part that is breaking the script.. That part doesn't break the script.

0

It does it's case sensitive.I'll come back later to check on it.

0

He's right about the capitalization of the method Kozero. The script isn't breaking due to the improper capitalization of the method, it's breaking somehow after the print.

0

And roblox is patching these scripts. So they wont work in the future, They already patched arceus's

1 answer

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

1 comment

0

Eh, it's probs because they are updating/fixing it. It gave me the player points for the game and everything, just never updated the leaderstats..

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