So, I’m making a script for a food bowl. It has a proximity prompt and if you’re holding a food box along with holding the proximity prompt until it ends. It deletes the food box and food is put into the bowl.
The problem: It says that the food box isn’t there even though you’re holding it. Here’s the script
Not related to the topic, but seeing that there is a variable called “isFull” you probably don’t want it to work if “isFull” is true. So the script should be like this:
local pp = script.Parent.Union.ProximityPrompt
local isFull = false
pp.PromptButtonHoldEnded:Connect(function(player)
local GatoSnack = player.Character:FindFirstChild("Gato Snack")
if GatoSnack and isFull == false then
print("Gato Snack poured!")
GatoSnack:Destroy()
pp.Parent.Parent.Food.Transparency = 0
isFull = true
else
print("Gato Snack not found!")
end
end)
OK its because your buying it in a localscript and then your looking for it in a server script and the server cant see the tool only the client can see the tool
you need to make sure the server gives the tool to the character
what you need to do is when the player clicks the button you send a remote event to the server and the server will clone the snack and adjust the bingusbux value