My script below is completed and it should work. Though when I press Y, it doesn’t do anything. Literally nothing, I have checked the Output and nothing is there so I’m practically stuck in one place which I can’t get out of. I am trying to make the script change UIs so make frame 1 not visible and frame 2 visible
–variables
local uis = game:GetService(“UserInputService”)
–change channel
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Y and script.Parent.Parent.mainframe.Visible == false then
script.Parent.Visible = false
script.Parent.Parent.mainframe.Visible = true
end
end)
The reason could be that the frames dont load, or function correctly, you could fix this by using variables. STARTIMPLEMENTINGVARIABLES INTO YOUR SCRIPTS!!!
local UIS = game:GetService("UserInputService")
local OnCallFrame = script.Parent
local GUI = OnCallFrame.Parent
local MainFrame = GUI:WaitForChild("mainframe")
UIS.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.Y and not MainFrame.Visible then
OnCallFrame.Visible = false
MainFrame.Visible = true
end
end
Try this instead then, if it doesnt work then its an issue with the frames. (or the script is disabled)
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
repeat wait() until Player.Character ~= nil
local RadioGui = PlayerGui.Radio
local OnCallFrame = RadioGui.oncallframe
local MainFrame = RadioGui.mainframe
UIS.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.Y and not MainFrame.Visible then
OnCallFrame.Visible = false
MainFrame.Visible = true
end
end