I have a group in workspace and I’m trying to get a child of that model but the name is a number and keeps returning nil I index it. Any help thanks
local OpenShop = game.ReplicatedStorage:WaitForChild("OpenShop")
local Gui = script.Parent:WaitForChild("ScreenGui")
local Frame = Gui.Frame
local Background = workspace:WaitForChild("BackgroundGroup", 5)
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local Number = 1
OpenShop.OnClientEvent:Connect(function(Open)
if Open then
wait(0.25)
Frame.Visible = true
print(Background:FindFirstChild(tostring(Number))) -- nil
end
end)
local OpenShop = game.ReplicatedStorage:WaitForChild("OpenShop")
local Gui = script.Parent:WaitForChild("ScreenGui")
local Frame = Gui.Frame
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local Number = 1
OpenShop.OnClientEvent:Connect(function(Open)
if Open then
wait(0.25)
Frame.Visible = true
print(workspace:WaitForChild("BackgroundGroup")["5"])
end
end)