I have a scoreboard script which is meant to add 1 every time the team scores. I am using intvalues for this, and it doesn’t change the text at all.
Here is the script:
local player = game.Players.LocalPlayer
local gui = player.PlayerGui:WaitForChild("Start", math.huge)
local val = Instance.new("IntValue")
val.Parent = game.ReplicatedStorage
val.Name = "ajax"
local val1 = Instance.new("IntValue")
val.Parent = game.ReplicatedStorage
val.Name = "inter"
local Away = workspace.AwayPart:GetChildren()
local Home = workspace.HomePart:GetChildren()
local HomeGK = workspace.HomeGKPart:GetChildren()
local AwayGK = workspace.AwayGKPart:GetChildren()
local Ref = workspace.RefPart:GetChildren()
local playersService = game:GetService("Players")
local scoreBoardGui = workspace.Score.ScoreboardGui
local elfScore = scoreBoardGui.Score.ParisScore
local gnomeScore = scoreBoardGui.Score.LiverpoolScore
local status = scoreBoardGui.Status
local timer = scoreBoardGui.Timer
local team = game.Teams
local goal1 = workspace["Away Goal"].WhitePart and workspace.goal2
local goal2 = workspace["Home Goal"].RedPart and workspace.goal1
local ball = workspace.TPS
local originalPosition = ball.Position
ball.Touched:Connect(function(part)
if part == goal2 then
val.Value = val.Value +1
gui.Scoreboard.AjaxScore.Text= tostring(val)
elseif part == goal1 then
val1.Value = val.Value +1
gui.Scoreboard.InterScore.Text = tostring(val)
end
end)
You have made typos between val and val1. I think this is the working version of your script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local player = Players.LocalPlayer
local gui = player:WaitForChild("PlayerGui"):WaitForChild("Start", math.huge)
local val = Instance.new("IntValue", ReplicatedStorage)
val.Name = "ajax"
local val1 = Instance.new("IntValue", ReplicatedStorage)
val.Name = "inter"
local Away = workspace.AwayPart:GetChildren()
local Home = workspace.HomePart:GetChildren()
local HomeGK = workspace.HomeGKPart:GetChildren()
local AwayGK = workspace.AwayGKPart:GetChildren()
local Ref = workspace.RefPart:GetChildren()
local scoreBoardGui = workspace.Score.ScoreboardGui
local elfScore = scoreBoardGui.Score.ParisScore
local gnomeScore = scoreBoardGui.Score.LiverpoolScore
local status = scoreBoardGui.Status
local timer = scoreBoardGui.Timer
local goal1 = workspace["Away Goal"].WhitePart and workspace.goal2
local goal2 = workspace["Home Goal"].RedPart and workspace.goal1
local ball = workspace.TPS
local originalPosition = ball.Position
ball.Touched:Connect(function(part)
if part == goal2 then
val.Value += 1
gui.Scoreboard.AjaxScore.Text = val.Value
elseif part == goal1 then
val1.Value += 1
gui.Scoreboard.InterScore.Text = val1.Value
end
end)
local player = game.Players.LocalPlayer
local gui = player.PlayerGui:WaitForChild("Start")
local val = game.ReplicatedStorage:WaitForChild("Ajax")
local val1 = game.ReplicatedStorage:WaitForChild("Inter")
local goal1 = workspace["Away Goal"].WhitePart and workspace.goal2
local goal2 = workspace["Home Goal"].RedPart and workspace.goal1
local ball = workspace.TPS
ball.Touched:Connect(function(part)
if part == goal2 then
val.Value = val.Value +1
gui.Scoreboard.AjaxScore.Text= val
elseif part == goal1 then
val1.Value = val.Value +1
gui.Scoreboard.InterScore.Text = val1
end
end)
if part == goal2 then
val.Value += 1
if val.Value > 7 then
val.Value = 0
end
gui.Scoreboard.AjaxScore.Text = val.Value
elseif part == goal1 then
val1.Value += 1
if val1.Value > 7 then
val1.Value = 0
end
gui.Scoreboard.InterScore.Text = val1.Value
end