Ive tried doing this many different ways but its not doing anything, not even printing or printing errors.
here is my code, what im trying to do is to make a custom proximity prompt, if im doing this inefficiently please reccomend a different way
local player = game.Players.LocalPlayer
local nonvis = player.nonvis
local uis = game:GetService("UserInputService")
local cs = game:GetService("CollectionService")
local ATMguis = cs:GetTagged("ATMgui")
script.Parent.Money.Text = "Your account: $"..nonvis.Bank.Value
nonvis.Bank.Changed:Connect(function()
script.Parent.Money.Text = "Your account: $"..nonvis.Bank.Value
end)
script.Parent.Deposit.MouseButton1Click:Connect(function()
script.Parent.DepositEvent:FireServer(script.Parent.TextBox.Text)
end)
script.Parent.Withdraw.MouseButton1Click:Connect(function()
script.Parent.WithdrawEvent:FireServer(script.Parent.TextBox.Text)
end)
script.Parent.X.MouseButton1Click:Connect(function()
script.Parent.Visible = false
end)
while wait() do
if script.Parent.Visible == true then
if player.Character.Humanoid.MoveDirection.Magnitude > 0 then
script.Parent.Visible = false
end
end
end
uis.InputBegan:Connect(function(input, isui)
if isui then return end
for i, v in pairs(ATMguis) do
if v.Visible == true and input.KeyCode == Enum.KeyCode.E then
script.Parent.Visible = true
end
end
end)
this gui should be showing up when the player presses E