Hello I’m making a game the players are not teleporting the blocks are not spawning.
Game:
local repstorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local block = repstorage.Block
local board = workspace.Lobby.GameStatus.Board
function createBlock()
local blockC = block:Clone()
blockC.Position = Vector3.new(math.random(1, 100),math.random(50),math.random(1, 100))
blockC.Parent = workspace
end
local playersInGame = {}
local playersAvailable = 0
--Game waiting for 2 players
while true do
wait()
for i, v in pairs(players:GetChildren()) do
if playersAvailable > 2 then
playersAvailable += 1
else
break
end
end
end
--Adding player tags
for i, v in pairs(players:GetChildren()) do
for i, w in pairs(repstorage:GetChildren()) do
if w.Name == v.Name then
table.insert(w, playersInGame)
end
end
end
--Game
for i, v in pairs(players:GetChildren()) do
v.Character:MoveTo(Vector3.new(0, 10, 0))
end
while true do
wait(1)
createBlock()
for i, v in pairs(repstorage) do
if not playersInGame[#playersInGame] < 0 then
if v:IsA("Boolean") then
if v.Value == false then
table.remove(playersInGame)
end
end
else
playersInGame[#playersInGame].Wins += 1
end
end
end
Tags
local repstorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(player)
local folder = Instance.new("Folder", player)
folder.Name = "leaderstats"
local wins = Instance.new("IntValue", folder)
wins.Name = "Wins"
local tag = Instance.new("BoolValue", repstorage)
tag.Name = (player.Name)
tag.Value = true
end)
players.PlayerRemoving:Connect(function(player)
for i, v in pairs(repstorage:GetChildren()) do
if v.Name == player.Name then
v:Destroy()
end
end
end)
Somebody please help.