I’m working on a votekick command (disaster), and uh, the entire code doesn’t run for some reason
local rStorage = game:GetService("ReplicatedStorage")
local tChatService = game:GetService("TextChatService")
-- Folders;
local events = rStorage:WaitForChild("Events")
local toClient = events:WaitForChild("ToClient")
local votekickUI = toClient:WaitForChild("VotekickUI")
-- Events;
local failedVotekickMessage = votekickUI.FailedVotekickMessage
local votekickCommand = tChatService:WaitForChild("Votekick")
local players = game:GetService("Players")
-- Get players;
local function GetPlayers()
local playerList = {}
for _,plr in ipairs(players:GetPlayers()) do
if not table.find(playerList, plr.Name) then
table.insert(playerList, plr.Name)
end
end
return playerList
end
-- Once command gets triggered;
local function OnCommandTriggered(origin: Player, unfilteredText: string)
local playerList = GetPlayers()
local args = string.split(unfilteredText, " ")
local playerName = args[2]
if playerName and table.find(playerList, playerName) then
else
print("Failed votekick, the provided player does not exist, or player wasn't provided at all.")
local message = "The player you've provided does not exist or you didn't provide a player at all. Please double check if the player exists and the player's username."
failedVotekickMessage:FireClient(origin, message)
end
end
votekickCommand.Triggered:Connect(OnCommandTriggered)
and this is (dora) the explorer: