How do i make a kill system with player points in my sword fighting game?
Like 1 kill = 1 player point? been stuck with this for hours now! please help!
does this work?
local PointsService = Game:GetService('PointsService')
_G.GivePlayerPoints = function(player, points)
if player and points then
points = math.floor(points)
local success, errorText = pcall(function()
local pointsAvailable = PointsService:GetAwardablePoints()
local pointsToAward = math.min(points, pointsAvailable)
_G.print(script.Name, "Awarding:", pointsToAward, "Total available:", pointsAvailable)
PointsService:AwardPoints(player.userId, pointsToAward)
_G.print(script.Name, "Done.\n")
end)
if not success then
_G.print(script.Name, "FAILURE! ErrorMsg:", errorText)
end
end
end

1 comment
Sorry