Cup Giver isn't working

Hi! I am trying to make a give to on my cafe game. Here is my code:

local ToolNames = {"Empty Cup"}
local Storage = game:GetService("ServerStorage")


local Part = script.Parent
local ClickDetector = Part:WaitForChild("ClickDetector")
local debounce = script.Parent.Use

ClickDetector.MouseClick:connect(function(Player)
	if Player and Player.Character and debounce.Value == "NotInUse" then
		debounce.Value = "Inuse"
		local Backpack = Player:WaitForChild("Backpack")
		for i = 1, #ToolNames do
			local Tool = Storage:FindFirstChild(ToolNames[i])
			if Tool then
				Tool:clone().Parent = Backpack
				wait(3)
				debounce.Value = "NotInUse"
			end
		end
	end
end)

Does anyone know why?

heres my other stuff btw
image
image

2 Likes

Is there something in ServerStorage called Empty Cup?

Is there any errors from the script? If so, can you please add them to your post?

I’ve recreated the script and structure identical to yours, and it works just fine. Are you sure the “Empty Cup” exists directly under ServerStorage, and that the name is identical to the one in the script?

May I see the script you have made?

It’s the exact same script and hierarchy you’ve sent.
image

image

image
Check if the name of your tool is properly spelled and capitalized.

1 Like

tysm! it was in a folder i believe. must’ve been one of my other devs