so basically i want to make it so i can only activate the prompt while holding a certain tool it dosent detect that i am holding the fruit and dosent print
local players = game:GetService("Players")
local fruitfolder = rs:WaitForChild("Fruits")
local container = script.Parent.Parent
local prompt = script.Parent
prompt.ClickablePrompt = false
local remev = prompt:WaitForChild("yes")
remev.OnServerEvent:Connect(function(player,equiped)
if equiped then
prompt.ClickablePrompt = false
elseelse
prompt.ClickablePrompt = true
end
end)
prompt.PromptButtonHoldBegan:Connect(function(olayer)
print(olayer.Name)
end)``` this is the server script
```local players = game:GetService("Players")
local player = players.LocalPlayer
local prox = script.Parent
local remev = prox:WaitForChild("yes")
local function checkfruit(fruit)
if fruit:IsA("Tool") then
fruit.Equipped:Connect(function()
remev:FireServer(true)
print(fruit.Name.."equipped")
end)
fruit.Unequipped:Connect(function()
remev:FireServer(player,false)
print(fruit.Name.."unequipped")
end)
end
end
players.PlayerAdded:Connect(function(player)
player.Backpack.ChildAdded:Connect(checkfruit)
end)``` local script
** You are now Level 1! **