--[[
	Commands:
	/kick
	/explode
	/trip
	/visible
	/invisible
]]


admin.kick = {
	["Command"] = "Kick",
	["Place"] = 1,
	
	["Function"] = function(arguments)
		local players = {}

		for i, playerName in pairs(arguments) do
			local player = findPlayer(playerName)

			if player then
				disconnect(player)
			end
		end
	end
}

admin.explode = {
	["Command"] = "Explode",
	["Place"] = 2,

	["Function"] = function(arguments)
		for i, playerName in pairs(arguments) do
			local player = findPlayer(playerName)

			if player then
				explode(player)
			end
		end
	end
}

admin.trip = {
	["Command"] = "Trip",
	["Place"] = 3,

	["Function"] = function(arguments)
		for i, playerName in pairs(arguments) do
			local player = findPlayer(playerName)

			if player then
				local humanoid = player.Character:FindFirstChild("Humanoid")

				if not humanoid then
					return
				end

				humanoid.PlatformStand = true
				task.wait(1.5)
				humanoid.PlatformStand = false
			end
		end
	end
}

admin.visible = {
	["Command"] = "Visible",
	["Place"] = 4,

	["Function"] = function(arguments)
		for i, playerName in pairs(arguments) do
			local player = findPlayer(playerName)

			if player then
				local character = player.Character or player.CharacterAdded:Wait()

				for i, v in pairs(character:GetDescendants()) do
					if v:IsA("Part") or v:IsA("BasePart") or v:IsA("MeshPart") then
						v.Transparency = 0
					end
				end

				character.HumanoidRootPart.Transparency = 1
				character.HitBox.Transparency = 1
			end
		end
	end
}

admin.invisible = {
	["Command"] = "Invisible",
	["Place"] = 5,

	["Function"] = function(arguments)
		for i, playerName in pairs(arguments) do
			local player = findPlayer(playerName)

			if player then
				local character = player.Character or player.CharacterAdded:Wait()

				for i, v in pairs(character:GetDescendants()) do
					if v:IsA("Part") or v:IsA("BasePart") then
						v.Transparency = 1
					end
				end

				character.HumanoidRootPart.Transparency = 1
				character.HitBox.Transparency = 1
			end
		end
	end
}

return admin
