Hello I am making a racing game with a friend and i need help making a script that says 1st 2nd and 3rd, i can handle the GUI but i could find no script, please direct me in the correct way.
(post withdrawn by author, will be automatically deleted in 1 hour unless flagged)
At the finish-line of the race, make an invisible part and script this inside the part:
game.Players.PlayerAdded:Connect(function(player)
script.Parent.Touched:Connect(function(hit)
local gui = script.Gui:Clone()
local hasbeenhit = 0
local hum = hit.Parent:FindFirstChildWhichIsA("Humanoid")
if hum and hasbeenhit == 0 then
hasbeenhit = hasbeenhit + 1
gui.Parent = player.PlayerGui
gui.TextLabel1.Text = hum.Parent .. "is in 1st place"
elseif hasbeenhit == 1 then
hasbeenhit = hasbeenhit + 1
gui.TextLabel2.Text = hum.Parent .. "is in 2nd place"
elseif hasbeenhit == 2 then
hasbeenhit = hasbeenhit + 1
gui.TextLabel3.Text = hum.Parent .. "is in 3rd place"
end
end)
end)
Thank you so much but do you know how to show it during a race? to say like your farther than others
Oh, so you basically want 4th place, 5th place, 6th place and etc?
not exactly, i am looking for it says that when you are in the race
So basically who’s in the race in a gui?
no so it says what you said but also what place they are in but just 1st 2nd and 3rd
A leaderboard and the top 3 players?
Oh wait, I just realized something.
I got my script wrong, a little change will happen.
Oh, thanks for that, that helped me understand it.
I’m just watching a race video and I don’t realize this
ok that’s fine as long as it could be of any use
Making the script may take a while, sorry about that.
oh ok thank you and so sorry i responded so late