So I am making this tool for searching other player’s backpack, but for some very weird reason, the local GUI frame on the client just won’t show up, its almost like all the GUI processes in the script just dissappeared.
This is the part of the script which causes me trouble:
local accepted, inv = patdownRequest:InvokeServer(targetPlayer)
if accepted == nil or accepted == false then allowPlayerPatdown() return end
print(patdownMainframe)
patdownMainframe.Visible = true
for i,v in pairs(inv) do
local button = patdownItemButton:Clone()
button.ZIndex = 1
button.Visible = true
button.Parent = patdownItemMenu
button.Text = v
button.MouseButton1Click:Connect(function()
patdownRemote:FireServer(v)
end)
end
for i = 10,0,-1 do
patdownTimer.Text = tostring(i)
task.wait(1)
end
patdownMainframe.Visible = false
the patdownMainframe just won’t set to visible, even though the print statement above it prints “Frame”, which brings me to another weird thing, being that when I click the printed instance in the output, it won’t highlight me the frame in explorer but shows me the script line instead.
by the way, the buttons in the pairs loop also aren’t created in the list, even though the table returned from the remoteFunction contains several strings, and when I added a print statement in the loop, it printed all the elements in the table, but the buttons just did not show up.
if anyone is interested, this is how I define the gui elements.
local players = game:GetService("Players")
local player:Player = players.LocalPlayer or players.PlayerAdded:Wait()
local playerGUI = player:WaitForChild("PlayerGui")
local patdownGUI = playerGUI:WaitForChild("patdown")
local patdownMainframe = patdownGUI:WaitForChild("Frame")
local patdownItemMenu = patdownMainframe:WaitForChild("ScrollingFrame")
local patdownItemButton = patdownItemMenu:WaitForChild("TextButton")
local patdownTimer = patdownMainframe:WaitForChild("patdownTimer")
and of course, everything is running in a local script.
From all this behaviour, it almost looks like there was like a copy of this whole player GUI somewhere, and all the actions were performed on it, since there are no errors and it acts like its working.
Another interesting thing is that when I did not define the patdown timer on the start, but instead in the for loop used patdownMainframe.patdownTimer, I got an error saying that patdownTimer doesnt exist as a child for the patdownMainframe, which is also extremely weird. I’ve been stuck on this for several days already, and I have completely ran out of ideas. Any help will be appreciated!