Input began wont fire

input began wont fire :sob:, basically my script looks for multiple ui frames to be clicked and if they get clicked i send something to the fire server. but that doesnt even matter if the input began DOESNT GET ANY INPUT, so why does input began not work? my zindex for the frames is bigger but they are all parents to the thing called main which is just some back ground gui

local function InputCheck(Chest)
	local UIClone = Chest.UI:WaitForChild("ChestGui")
	for _, Frame in pairs(UIClone.Main:GetChildren()) do
		if Frame.Name == "UIGridLayout" then continue end
		print(Frame) -- only prints this nothing else
		Frame.InputBegan:Connect(function(Input) --here is the problem supposedly
			print("woah") -- no print
			if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then			
				if Frame.Name == "Delete" then
					Event:FireServer("Delete")
					print("youch")-- no print
				else
					print("Yipee")-- no print
					Event:FireServer(Frame.Text.Text)
				end
			end
		end)
	end
end

could the order of my UI layout be a hinderence?

How is your chest built? Is the UI on it a SurfaceGUI or is this within the on screen PlayerGUI?
If you can put a picture of your explorer with the structure that would help.

Also, it might help to have a type check on the Frame so you can make sure it even has the .InputBegan event.

1 Like
local function InputCheck(Chest)
	local UIClone = Chest.UI:WaitForChild("ChestGui")
	
	for _, Frame in pairs(UIClone.Main:GetChildren()) do
		if Frame.Name == "UIGridLayout" then continue end
		print(Frame)
		
		if Frame.Name == "Delete" then
			Frame.Button.Activated:Connect(function()
				Event:FireServer("Delete")
				print("s")

			end)
		end
		
		Frame.Button.Activated:Connect(function()
			Event:FireServer(Frame.Text.Text)
			print("f")
		end)
	end
end

i have completely changed my approach and went to text buttons WHCIH STILL DONT WORK. also i have a screen gui, and there is only one other frame parenting the frame in question

There’s not much documentation on GuiButton.Activated. I would try using MouseButton1Down or MouseButton1Click instead.

1 Like

I’m going to second that ^ try using MouseButton1Click

i found the problem being the screen gui being INSIDE the part but for me the adornee thing isnt working

Use this code:

local function InputCheck(Chest)
	local UIClone = Chest.UI:WaitForChild("ChestGui")
	for _, Frame in pairs(UIClone.Main:GetChildren()) do
		if Frame.Name == "UIGridLayout" then continue end
		print(Frame) -- only prints this nothing else
		Frame.InputBegan:Connect(function(Input, gpe) --here is the problem supposedly
			if gpe then return end;
			print("woah") -- no print
			if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then			
				if Frame.Name == "Delete" then
					Event:FireServer("Delete")
					print("youch")-- no print
				else
					print("Yipee")-- no print
					Event:FireServer(Frame.Text.Text)
				end
			end
		end)
	end
end
1 Like

ok turns out im slow in the head and the only problem was that i put my surface gui as a child to the part instead of adorneeing it but a new problem emerges. :sob: when setting adornee by local script the adornee is set but nothing happens