Hello Everyone.
Im have multiple different shop GUIs, and what im tyring to do here is opening the correct one (which is the one linked to the closest interactive block to the player).
Here is the problematic bit of my local script, a function which connected to the guiFinishEvent of the remote event
The Problem: the guiList is empty and that causes the for loop not to run, but im not sure why it is since there’s clearly gui Objects under PlayerGui
local player = game.Players.LocalPlayer
local guiList = player.PlayerGui:GetChildren()
local function guiFinish(shopID)
print("function works") --the function actually gets fired
for v,b in pairs(guiList) do
print("looping")
local gui = b
local guiID = b:FindFirstChild("guiID")
if (shopID.Value == guiID.Value) then
gui.Enabled = true
end
end
end
guiFinishEvent.OnClientEvent:Connect(guiFinish)