~~~~~~~~~~~~~~~~~ points = script.Parent.Parent.Parent.Parent.leaderstats.Points
script.Parent.Text = "points: "..points.Value points.Changed:connect(function() script.Parent.Text = "points: "..points.Value end) local Homepoints = 0 local Awaypoints = 0
local UpdateEvent = Instance.new("RemoteEvent") UpdateEvent.Name = "UpdateWinner" UpdateEvent.Parent = game.ReplicatedStorage
for _,plr in pairs(game:GetService("Teams").Home:GetPlayers()) do Homepoints = Homepoints + plr.Backpack.leaderstats["Team points"].Value end for _,plr in pairs(game:GetService("Teams").Away:GetPlayers()) do Awaypoints = Awaypoints + plr.Backpack.leaderstats["Team points"].Value end if Homepoints> Awaypoints then
UpdateEvent:FireAllClients("Home")
elseif Awaypoints > Homepoints then
UpdateEvent:FireAllClients("Away")
else
UpdateEvent:FireAllClients("Neither")
end~~~~~~~~~~~~~~~~~
The script wont work, can anybody help? Also, how would I do it so if the ball touches certain part the team/player gets points (please dont delete i need help.)
Closed as Not Constructive by User#6546
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?