Hello devs, Im making a admin script which includes in safezone pack and my add_whitelist_tool command is not working the probelm is “print(player, char)” here. In “print(admin, tool)”, it prints Admin name and tool name player chattted but In “print(player, char)”, it prints nil and nil
Commands[Add_WhitelistTool_Command] = function(admin, tool)
if safezone then
print(admin, tool)
local player = game.Players:FindFirstChild(admin)
local char = workspace:FindFirstChild(admin)
print(player, char)
if player and char then
local tool = player.BackPack:FindFirstChild(tool) or char:FindFirstChild(tool)
if tool then
local whitelist_folder = safezone:FindFirstChild("Whitelist Tools")
if whitelist_folder then
tool:Clone().Parent = whitelist_folder
local toolsfolder_of_backpack = game:GetService("ServerStorage"):FindFirstChild(admin.."'s Tools Folder")
if toolsfolder_of_backpack then
tool.Parent = toolsfolder_of_backpack
end
end
end
end
end
end
hmmm… it could be that, your player name for the admin does not exist.
as Infinite Yield on a WaitForChild() meaning that it does not exist in the Players