input began wont fire , 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
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.
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
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
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. when setting adornee by local script the adornee is set but nothing happens