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

Player Point Help?

So I made this script, it worked one time this morning, but now it is not working. Basically when you touch the part, it gives you a single player point. It doesnt award player points. All it does is print the of the plr and the players bodypart that touched it.

debounce=false
script.Parent.Touched:connect(function(hit)
	print(hit.Name)
	plr=game.Players:GetPlayerFromCharacter(hit.Parent)
		
		
	if plr then
		print(plr.Name)
		if debounce==true then
			
		
elseif debounce==false then	
		debounce=true
	local PointsService = Game:GetService("PointsService")
 
	local pointsToAward = PointsService:GetAwardablePoints()
	
	local universeBalance = PointsService:GetGamePointBalance(plr.userId)
	
	if ( pointsToAward < 0 and universebalace == 0) then
		print("No Points left")	
	elseif ( pointsToAward > 0 and universeBalance == 0) then
		
		pcall(function()
			PointsService:AwardPoints(plr.userId, 1)
		end)
	end

	wait(5)
	debounce=true
	end
	end
	end)

1 answer

✓ Accepted answer

if ( pointsToAward < 0 and universebalace == 0) on line 20 should be if ( pointsToAward < 0 and universeBalance == 0)

1 comment

0

O thats probably bad

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