I’m trying to make a tool giver that denies if you already have the tool, but for some reason when you have the tool equipped it still gives you it anyway.
I tried looking for a solution when the game is running to see where the tool goes if you have it equipped, and it goes into the player’s model. But, when i tried making it check for when the tool is inside the player, it still didn’t work. Anyone have any ideas?
Code:
local Toolname = ("Goala Cola") -- checks for the name of the tool
local Storage = game:GetService("ServerStorage")
local Tool = Storage:FindFirstChild(Toolname) -- checks for the actual tool
local Part = script.Parent
local ProximityPrompt = script.parent.ProximityPrompt
ProximityPrompt.Triggered:Connect(function(Player)
if Player and Player.Character then
local Backpack = Player:WaitForChild("Backpack")
local Character = Player.Character
if not Backpack:FindFirstChild(Toolname) or not Character:FindFirstChild(Toolname)
script.Parent.bass:Play() -- for extra sauce
Tool:clone().Parent = Backpack -- gives you the tool
elseif Backpack:FindFirstChild(Toolname) then
Part.deny:Play() -- indicates you already have the tool
end -- does nothing
end
end)