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

This is forbidden?

Asked by
lomo0987 250 Moderation Voter
10 years ago

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)

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. Kozero 120 — 10y
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. lomo0987 250 — 10y
0
It does it's case sensitive.I'll come back later to check on it. Kozero 120 — 10y
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. M39a9am3R 3210 — 10y
0
And roblox is patching these scripts. So they wont work in the future, They already patched arceus's RolandStudio 115 — 10y

1 answer

Log in to vote
0
Answered by
Dummiez 360 Moderation Voter
10 years ago

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

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.. lomo0987 250 — 10y
Ad

Answer this question