-
What do you want to achieve?
I want the game to start when at least two players have hit/touched the start part. -
What is the issue? So far no matter which way I write the script it is not working properly.
One player can teleport currently if i jump several times
Two players can teleport if they jump several times
Currently a player only has to jump twice to be teleported
Also oddly when testing with two players the Player Count table only seems to grab Player1 even if Player2 hits the part ? I’ve included a screen print of the output window showing that table print, even though both players hit the part it only recorded Player1.
-
What solutions have you tried so far? I’ve tried:
Remote Event Fire
Various tables
Counts with IntValue
Teams, lobby vs players
This image depicts what happens with Player Count in test mode with two players
On this test, Player 1 hit the start and so did Player 2, but it only recognizes Player 1

Explorer Window of my Start Part being Hit/Touched

startrace = game.Workspace.Race.StartRace
local PlayerService = game:GetService("Players")
local PlayerCount = script.Parent.PlayerCount
boxnewpos = Vector3.new(-623.995, 2.49, 108.233)
pc = {} -- used with PlayerTouchedFunction
startpad = {}
playteam = {}
local playingTeam = game.Teams.Playing
playingTeam.Name = "Playing"
local lobbyTeam = game.Teams.Lobby
player = game:GetService("Players").PlayerAdded:Wait()
player.Team = lobbyTeam
local function PlayerTouched(startrace)
PlayerCount.Value = PlayerCount.Value + 1
print(PlayerCount.Value)
table.insert(pc, player.UserId)
player.Team = playingTeam
local sgui = player:WaitForChild("PlayerGui"):WaitForChild("StartNameGui")
local txtlbl = sgui.TextLabel
table.insert(startpad, player.Name)
print(startpad, player.Name)
table.insert(playteam,player.Team)
print(playteam,player.Team)
end
local db = true
startrace.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if db == true then
db = false
PlayerTouched(startrace)
local player = hit.Parent
local PlayerCount = script.Parent.PlayerCount
if player then
for i, v in pairs(playteam) do
if PlayerCount.Value >= 2 and #playteam >=2 and playingTeam.Name == "Playing" then
wait() -- wait before tp the players in case more join- may add this in later
box = game.Workspace.Race.box
box.Transparency = 0
box.Position = boxnewpos
local torso = player.HumanoidRootPart
torso.CFrame = CFrame.new(-953.054, 521.008, 789.054)
else
print("NeedTwo")
end
end
end
wait(7)
db = true
end
end
end)
This was my remote event that was in Replicated Storage when I tried to use it and could not get it to work, so I took it out of the script I have included now because I started to test with Teams instead.
![]()
This is my script in Server Script Service for when I tested the Remote Event
![]()
script in Server Script Service for firing remote event
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
local StartPadNameUpdate = game.ReplicatedStorage:WaitForChild("StartPadNameUpdate")
wait(1)
StartPadNameUpdate:FireAllClients("StartNameGui","TextLabel","TextLabel.Text")
end)
This is my setup for the StarterGui, SurfaceGui. I tried with a script and a local script and an adorne of the gui to the start part. Its sort of working because my player.Name does show on the part when i touch it, image displays this works. I just couldn’t use it for the teleport when two players hit script portion.

Script in Starter Gui for - I tried various versions of this script as well and couldn’t get it to work
I am however successfully updating the player.Name to appear on the start part. It only shows the last player who hit the part though.
local Players = game:GetService("Players")
plr = game.Players.LocalPlayer
local rs = game:GetService("ReplicatedStorage")
fireitup = rs:WaitForChild("StartPadNameUpdate")
local debounce = false
start.Touched:Connect(function(hit)
if debounce == false then
debounce = true
plr = hit.Parent
if plr then
txtlbl.Text = plr.Name
end
end
wait()
debounce = false
end)
