I don't know how to fully set up the new player point system. The script will take Cash from them but it won't give them any player points and the button breaks. So I believe it has to do with the player points. If you could help me that would be nice.
local PointsService = Game:GetService("PointsService")
local ting = 0
function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")
if stats ~= nil then
local cash = stats:findFirstChild("Cash")
cash.Value = cash.Value - 20000
PointsService:AwardPoints(hit.userId, 1)
wait(5)
end
end
ting = 0
end
end
script.Parent.Touched:connect(onTouched)

2 comments
It's messed up sorry
Their was supposed to be a line space between the print line and the wait line after it.