Is it possible to add 2 buttons to a Proximity Prompt? I tried making an attempt but it’s not working, nothing is being output, is there any explanation as to why? If it isnt possible then I’m going to have to use a billboard gui.
My code(script inside of a ProximityPrompt)
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Part = script.Parent.Parent
local ProximityPrompt = script.Parent
local EatKey = Enum.KeyCode.X
local CarryKey = Enum.KeyCode.Z
ProximityPrompt.Triggered:Connect(function(player)
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == EatKey then
print("Ate Food")
elseif input.KeyCode == CarryKey then
print("Carried Food")
end
end)
end)
From my experience with proximity prompts, they currently dont have the ability to take in two inputs.
Looking at the system you have right now, an idea is to have the proximity prompt only take the Z input of carrying, then have the water in the players inventory, then in order for the player to drink it, they would have it in their inventory and press a key while equiped to drink.
Makes sense, I transferred the code over to a local script but the same problem is occuring, nothing is being output and its not printing (“ate food”) or (“carried food”)