I want to have it so that if you are holding nothing or a tool (except the wire) the button will be clickable with the proximity prompt. Once you hold out one of the connectors, the second proximity prompt inside the button will be enabled and the click one will be disabled.
Currently, if you hold nothing or a tool out, you will be able to click the button as intended. However, if you hold the wire out, the click prompt stays enabled and the other one stays disabled.
Here is my code. This is a local script inside of the button. I am using local scripts because I don’t want other people’s proximity prompts to be changed if someone else nearby is holding a wire.
while true do
if game.Players.LocalPlayer.Character:FindFirstChild("Connector 1") or game.Players.LocalPlayer.Character:FindFirstChild("Connector 2") then
script.Parent.Parent.Click.Enabled = false --this is supposed to disable the click prompt
script.Parent.Enabled = true --this is supposed to enable the wire prompt
end
wait()
end
Originally, I didn’t have the while loop but then I realized that this didn’t have a reason to trigger so I added it so that it constantly checks for the player holding out the wire. That’s all I have to say. Any help would be very appreciated as this is a big part of the game