Well. I need help with this and it is that the script detects when a specific object touches a part, it detects it and it does its function and it works. But in the ProximityPrompt part, it should also detect the tool but it doesn’t.
local OpenPos = script.Parent.Parent.Parent.Parent:WaitForChild("Ventanilla"):WaitForChild("OpenPos")
local ClosePos = script.Parent.Parent.Parent.Parent:WaitForChild("Ventanilla"):WaitForChild("ClosePos")
local Ventanilla = script.Parent.Parent.Parent.Parent:WaitForChild("Ventanilla"):WaitForChild("Ventanilla")
local Herramienta = script.Parent.Parent.Parent.Parent:WaitForChild("Ventanilla"):WaitForChild("Herramienta")
local openSound = script.Parent.Parent.Parent.Parent:WaitForChild("Base"):WaitForChild("Base"):WaitForChild("AbirPuerta")
local closeSound = script.Parent.Parent.Parent.Parent:WaitForChild("Base"):WaitForChild("Base"):WaitForChild("CerrarPuerta")
local Touch = script.Parent.Parent.Parent.Parent.Touch
local tweenService = game:GetService("TweenService")
Herramienta.Value = true
local ButtonPress = false
local ButtonPress2 = false
local IdComida = script.Parent.Parent.Parent.Parent:WaitForChild("TipoDeComida")
local PosicionComida = script.Parent.Parent.Parent.Parent:WaitForChild("PlatoyPos")
local FoodInicioPos = PosicionComida.FoodEndPos
local FoodEndPos = PosicionComida.FoodEndPos
local Proximity = script.Parent
Touch.Touched:Connect(function(player)
ButtonPress = false
ButtonPress2 = true
if player.Parent:FindFirstChild("Card") ~= nil then
Proximity.Enabled = true
IdComida.Value = "Card"
Proximity.ActionText = "Calentar Card"
end
if player.Parent:FindFirstChild("Esposas") ~= nil then
Proximity.Enabled = true
IdComida.Value = "Esposas"
Proximity.ActionText = "Calentar Esposas"
end
end)
Touch.TouchEnded:connect(function(player)
ButtonPress = false
ButtonPress2 = true
Proximity.Enabled = false
end)
local debounce = true
Proximity.Triggered:Connect(function(player)
if debounce == true then
debounce = false
if Herramienta.Value == true then
Herramienta.Value = false
closeSound:Play()
tweenService:Create(Ventanilla,TweenInfo.new(.35),{CFrame = OpenPos.CFrame}):Play()
wait(0.3)
print("god")
if player.Parent:FindFirstChild("Card") ~= nil then
local comida = player.Parent:FindFirstChild("Card")
if comida then
comida.Parent = PosicionComida
tweenService:Create(comida,TweenInfo.new(.35),{CFrame = FoodInicioPos.CFrame}):Play()
wait(0.4)
tweenService:Create(comida,TweenInfo.new(.35),{CFrame = FoodEndPos.CFrame}):Play()
end
end
--tweenService:Create(Ventanilla,TweenInfo.new(.35),{CFrame = ClosePos.CFrame}):Play()
Herramienta.Value = true
wait(0.4)
debounce = true
end
end
end)