So I am practicing on tables or arrays, I don't really know what they're called; anywho, why does the chosen player not get the sword?
Script:
local serverStorage = game:GetService("ServerStorage")
local plrs = game:GetService("Players")
local Sword = serverStorage:WaitForChild("Sword")
local waitListTable = {}
plrs.PlayerAdded:Connect(function(plr)
table.insert(waitListTable, plr)
print(waitListTable)
if #waitListTable == 3 then
local imposterIndex = math.random(1, #waitListTable)
local Imposter = waitListTable[imposterIndex]
local clonedSword = Sword:Clone()
local Backpack = Imposter:WaitForChild("Backpack")
print(Imposter.Name.." is the Imposter!")
clonedSword.Parent = Backpack
--[[if Imposter == nil then
print("he left")
end]]
end
end)
** You are now Level 6! **