Admin Tool Code Not Working

There are no errors inside the console
This script is located in ServerScriptService
The Tool Is Not Being Sent to the BackPack

Code:

game.Players.PlayerAdded:Connect(function(player)

-- Functions --

local function Check_If_Admin(Player_To_Check)
	if Player_To_Check.UserId == 107799639 then
		return true
	else
		return false
	end
end

local function Give_Admin_Stuff(Player_To_Give)
	local Admin_Panel_Clone =  game.ServerStorage.Storage.Gui.Admin_Panel:Clone()
	local Tool_Clone = game.ServerStorage.Storage.Admin.Ban_Hammer:Clone().Parent == Player_To_Give.Backpack
	
   Admin_Panel_Clone.Parent = Player_To_Give.PlayerGui
   Admin_Panel_Clone.Main.Main.Enabled = true
end

local Check_If_Admin_Return = Check_If_Admin(player)

if Check_If_Admin_Return == true then
	Give_Admin_Stuff(player)
end

end)
``

1 Like

Looks like you are setting the parent of the tool, whilst setting the variable.

Try this:

local Tool_Clone = game.ServerStorage.Storage.Admin.Ban_Hammer:Clone()
Tool_Clone.Parent = Player_To_Give.Backpack
2 Likes

so this isn’t really related to the topic (sorry) but i would highly reccomend using abbreviations instead of long variables like Player_To_Check. I would change that one to ptc.

1 Like

That did not work either i did that originaly but tried my current method because it wasnt working

1 Like