Hello. I'm making a shooting game with 5 teams, & whatever team gets a certain number of points win. If someone on a team kills someone from another team (like if a blue player kills a yellow player), that team gets 1 point (team blue). Here's my script:
-- declare service local PointsService = Game:GetService("PointsService") -- Bind function to player added event game.Players.PlayerAdded:connect(function(player) -- Get total number of points this game has already awarded to the player local universeBalance = PointsService:GetGamePointBalance(player.userId) -- Check if the player hasn't gotten any points yet. If true, award the points. if ( universeBalance == 0) then PointsService:AwardPoints(player.userId, 1) end end) -- Bind function to when points are successfully awarded PointsService.PointsAwarded:connect(function(userId, userBalanceinUni, userBalance) -- Show message indicating that a player has gotten points local message = Instance.new('Message', game.Workspace) message.Text = "Point awarded to " .. userId .. ". This player now has " .. userBalance .. " points total!" wait(5) message:Destroy() end) --Add this to your weapon script and call it when a player is killed local PointsService = game:GetService("PointsService") function awardPoints(creator) if time() - lastAwardedTime < 5 then return else lastAwardedTime = time() PointsService:AwardPoints(creator.Value, 1) end end --// In the future, please put your code in a code block. All you have to do is click the blue button in edit mode, and put your code between the lines.
I already made the teams & spawn locations; but for some reason, my script won't work. Please help, this is my first game. Also, what server should it be on? Thanks.