I am basically trying to make a 1v1 matching system that teleports the player when they step on a specific platform (should at least contain 2 players) and click a start button(It pops up when two or three players are on both platform) but cant seem to figure out how I should do this. Any Example?
✓ ANSWER ACCEPTED
How to make a 1v1 matching system?
1 answer
✓ Accepted answer
just made this one the fly but i guess it would look something like this:
local player1 = "None"
local player2 = "None"
local Platfrom1 = "" --platoform location in workspace
local Platfrom2 = "" --platoform location in workspace
local Destenation1 = "" --Brick location in workspace
local Destenation2 = "" --Brick location in workspace
local timer = 30 --countdown in 30 seconds
--Get player1
Platfrom1.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
player1 = player.Name
end
end)
--Get player2
Platfrom2.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
player2 = player.Name
end
end)
Platfrom2.TouchEnded:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
player2 = "None"
end
end)
Platfrom1.TouchEnded:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
player1 = "None"
end
end)
while wait(1) do
timer = timer - 1
print(timer)
if timer == 0 then
if not player1 == "None" then
if not player2 == "None" then
if game:GetService("Players"):FindFirstChild(player1)then
game:GetService("Players"):FindFirstChild(player1):WaitForChild("Character").HumanoidRoot.Cframe = Destenation1.CFrame
end
if game:GetService("Players"):FindFirstChild(player2)then
game:GetService("Players"):FindFirstChild(player2):WaitForChild("Character").HumanoidRoot.Cframe = Destenation2.CFrame
end
end
end
timer = 30
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
there was a problem on line 13 "attempted to index nil with 'Connect' "
did u specify the part
like u have to replace the "" with game.workspace.platform1
I did