I've had goal-line technology for nearly a year now... The script also teleports the ball back to the center circle. Here you go!
Put in a normal script in Workspace
01 | team 1 = game.Teams [ "team1" ] |
02 | team 2 = game.Teams [ "team2" ] |
06 | model = game.Workspace.Ball |
11 | new_model = backup:clone() |
12 | new_model.Parent = game.Workspace |
13 | new_model:MakeJoints() |
14 | model = game.Workspace.Ball |
18 | if part.Name = = "Ball" then |
19 | game.Workspace.Team 2 Score.Value = (game.Workspace.Team 2 Score.Value+score) |
25 | if part.Name = = "Ball" then |
26 | game.Workspace.Team 1 Score.Value = (game.Workspace.Team 1 Score.Value+score) |
31 | game.Workspace.Goal 1. Touched:connect(onG 1 ) |
32 | game.Workspace.Goal 2. Touched:connect(onG 2 ) |
Put in a normal script in the score GUI
01 | team 1 = game.Teams [ "team1" ] |
02 | team 2 = game.Teams [ "team2" ] |
08 | script.Parent.Label 1. Text = team 1. Name.. " " .. type .. " " ..game.Workspace.Team 1 Score.Value |
09 | script.Parent.Label 2. Text = team 2. Name.. " " .. type .. " " ..game.Workspace.Team 2 Score.Value |
The Scoreboard (You'll see what I mean) needs to be in a Frame (You can re-size if how you want) and inside this frame, 2 text boxes. They are named Label1 & Label2. In Label1, change the text to "Team1 Score" and in Label2, change it to "Team1 Score" (WITHOUT THE QUOTATION MARKS!)
Make sure the script and 2 text boxes are in the same directory in that frame.
I also have 2 scripts in the ball that I forgot (As it's been about a year) if they are linked to this or not, so add them anyways!
Inside the ball, in a script named Hit
01 | function onTouched(hit) |
02 | local torso = hit.Parent:findFirstChild( "Torso" ) |
04 | game.Workspace.GKWait 1. CanCollide = false |
05 | game.Workspace.GKWait 1 a.CanCollide = false |
06 | game.Workspace.GKWait 1 b.CanCollide = false |
07 | game.Workspace.GKWait 1 c.CanCollide = false |
09 | script.Parent.PFix.Disabled = false |
15 | script.Parent.Touched:connect(onTouched) |
The other is named Touch
01 | function onTouched(hit) |
02 | if hit.Parent:FindFirstChild( "Humanoid" )~ = nil then |
03 | X = game.Players:playerFromCharacter(hit.Parent) |
04 | if X.TeamColor = = BrickColor.new( "Bright green" ) then |
05 | game.Workspace.Hit.Value = BrickColor.new( "Bright green" ) |
08 | script.Parent.Touched:connect(onTouched) |
10 | function onTouched(hit 1 ) |
11 | if hit 1. Parent:FindFirstChild( "Humanoid" )~ = nil then |
12 | X = game.Players:playerFromCharacter(hit 1. Parent) |
13 | if X.TeamColor = = BrickColor.new( "Bright blue" ) then |
14 | game.Workspace.Hit.Value = BrickColor.new( "Bright blue" ) |
17 | script.Parent.Touched:connect(onTouched) |
19 | function onTouched(hit 2 ) |
20 | if hit 2. Parent:FindFirstChild( "Humanoid" )~ = nil then |
21 | X = game.Players:playerFromCharacter(hit 2. Parent) |
22 | if X.TeamColor = = BrickColor.new( "Camo" ) then |
23 | game.Workspace.Hit.Value = BrickColor.new( "Camo" ) |
26 | script.Parent.Touched:connect(onTouched) |
28 | function onTouched(hit 3 ) |
29 | if hit 3. Parent:FindFirstChild( "Humanoid" )~ = nil then |
30 | X = game.Players:playerFromCharacter(hit 3. Parent) |
31 | if X.TeamColor = = BrickColor.new( "Really blue" ) then |
32 | game.Workspace.Hit.Value = BrickColor.new( "Really blue" ) |
35 | script.Parent.Touched:connect(onTouched) |
37 | function onTouched(hit 4 ) |
38 | if hit 4. Parent:FindFirstChild( "Humanoid" )~ = nil then |
39 | X = game.Players:playerFromCharacter(hit 4. Parent) |
40 | if X.TeamColor = = BrickColor.new( "Bright green" ) or X.TeamColor = = BrickColor.new( "Camo" ) then |
41 | game.Workspace.Scorer 1. Value = X.Name |
44 | script.Parent.Touched:connect(onTouched) |
46 | function onTouched(hit 5 ) |
47 | if hit 5. Parent:FindFirstChild( "Humanoid" )~ = nil then |
48 | X = game.Players:playerFromCharacter(hit 5. Parent) |
49 | if X.TeamColor = = BrickColor.new( "Bright blue" ) or X.TeamColor = = BrickColor.new( "Really blue" ) then |
50 | game.Workspace.Scorer 2. Value = X.Name |
53 | script.Parent.Touched:connect(onTouched) |
I'm pretty sure that's all you need. Feel free to use it or any other ideas you got!