Tool Error Help

I’m having issues with the player tool backpack.

I’m attempting to edit a tool value, but as of right now it can only be edited when the tool is not equiped. Heres the script I have so far:

local ToolName = {"Cup"} -- Current Tool Name
local Storage = game.ServerStorage -- Tool Location


local Part = script.Parent.Parent
local ProximityPrompt = script.Parent

ProximityPrompt.Triggered:connect(function(Player)
	script.Parent.Parent.Sound:Play()
	if Player.Backpack.Cup.Name == "Cup" then
		Player.Backpack.Cup.Name = "Milk"
		Player.Backpack.Milk.Drink.Transparency = 0
	end
end)

Any help is appriciated.

Your script is looking for the Cup in the player’s backpack and not inside the Player.Character which is where the tool is located whilst equipped.

Thanks so much! Worked perfectly.

1 Like