I can give you the Working Code from the Cooking ones.
THIS ONE IS IN THE STARTER PACK:
local player = game.Players.LocalPlayer
local toolName = "PlateWithSteak"
local backpack = player:WaitForChild("Backpack")
local character = player.Character or player.CharacterAdded:Wait()
local proximityPrompt = workspace.PlacementOne.PlateWithSteakProx
local tool = backpack:FindFirstChild(toolName)
local function updatePrompt()
if tool and character:FindFirstChild(toolName) then
proximityPrompt.Enabled = true
else
proximityPrompt.Enabled = false
end
end
updatePrompt()
character.ChildAdded:Connect(function(child)
if child.Name == toolName then
tool = child
updatePrompt()
end
end)
character.ChildRemoved:Connect(function(child)
if child == tool then
tool = nil
updatePrompt()
end
end)
proximityPrompt.Triggered:Connect(function()
if tool then
tool:Destroy()
end
end)
AND THIS ONE IS IN THE PROXIMITY PROMT:
local ProximityPrompt = script.Parent -- Adjust this to the actual path of your ProximityPrompt
local ToolName = "PlateWithSteak"
local modelToClone = game.ServerStorage.PlateWithSteakModel
local spawnPosition = Vector3.new(-50.3, 2.45, 13.35)
local function checkForToolEquipped(player)
local character = player.Character
if character then
local tool = character:FindFirstChild(ToolName)
if tool then
local clonedModel = modelToClone:Clone()
clonedModel.Parent = game.Workspace
clonedModel:SetPrimaryPartCFrame(CFrame.new(spawnPosition))
-- Set the PrimaryPart
clonedModel.PrimaryPart = clonedModel:FindFirstChild("Plate") --
print("Player has the tool Plate with Steak equipped.")
end
end
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
checkForToolEquipped(player)
end)
end)
ProximityPrompt.Triggered:Connect(function(player)
checkForToolEquipped(player)
end)
What i want is Just that the Game Knows when the Tool Names “Suitcase” is Equiped and the Promt gets Enabled and when the Promt is triggered the Second script just removes the Tool.
I tried re writing the code but i always end up with a Infinite Yield or a Nil
Like said the Code works fine for its original Purpose which was checking if the player had a Plate in Equiped and the Plate then got Cloned to a Specific spot on a table and the item was destroyed out of the players inventory.