You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Score Text should be the players score. -
What is the issue? Include screenshots / videos if possible!
It takes a random persons score everty time -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
devfourms
Main Code:
game.ReplicatedStorage.Remotes.EatFood.OnServerEvent:Connect(function(player)
if player.Name == randomPlayer1.Name then
script.Parent.Values.Points1.Value += 1
else
if player.Name == randomPlayer2.Name then
script.Parent.Values.Points2.Value += 1
else
if player.Name == randomPlayer3.Name then
script.Parent.Values.Points3.Value += 1
end
end
end
end)
Score Code:
local Chair1 = script.Parent.Parent.Parent.Parent.Parent.Seats.Position1
local Chair2 = script.Parent.Parent.Parent.Parent.Parent.Seats.Position2
local Chair3 = script.Parent.Parent.Parent.Parent.Parent.Seats.Position3
local Name1 = script.Parent.Score1.Name1
local Score1 = script.Parent.Score1.Score1
local Name2 = script.Parent.Score2.Name2
local Score2 = script.Parent.Score2.Score2
local Name3 = script.Parent.Score3.Name3
local Score3 = script.Parent.Score3.Score3
local endedRace = false
Chair1:GetPropertyChangedSignal("Occupant"):Connect(function()
local hum = Chair1.Occupant
if not hum then return end
local plr = game.Players:GetPlayerFromCharacter(hum.Parent)
if not plr then return end
Name1.Text = plr.Name
warn("Changed Name")
end)
Chair2:GetPropertyChangedSignal("Occupant"):Connect(function()
local hum = Chair2.Occupant
if not hum then return end
local plr = game.Players:GetPlayerFromCharacter(hum.Parent)
if not plr then return end
Name2.Text = plr.Name
warn("Changed Name")
end)
Chair3:GetPropertyChangedSignal("Occupant"):Connect(function()
local hum = Chair3.Occupant
if not hum then return end
local plr = game.Players:GetPlayerFromCharacter(hum.Parent)
if not plr then return end
Name3.Text = plr.Name
warn("Changed Name")
end)
while true do
task.wait()
Score1.Text = script.Parent.Parent.Parent.Parent.Parent.Values.Points1.Value
Score2.Text = script.Parent.Parent.Parent.Parent.Parent.Values.Points2.Value
Score3.Text = script.Parent.Parent.Parent.Parent.Parent.Values.Points3.Value
end