I'm working on a Gui script which works perfectly when I run it in test mode but then when I run it in a server I get the is error: "Players.Player1.PlayerGui.ScreenGui.MapMenu.Maps.Kamino.Loc:2: attempt to index a nil value" Am I doing the 'FindFirstChild' function correctly? I've had a friend who is more advanced at scripting take a look at it and they said the couldn't spy any errors.
local pic = script.Parent.Parent.Parent:FindFirstChild("Pic")
local info = script.Parent.Parent.Parent:FindFirstChild("Info").info
local n = script.Parent.Parent.Parent:FindFirstChild("Info").Title
local place = script.Parent.Parent.Parent:FindFirstChild("Menu").Enter.LocalScript.PlaceID
local LS = script.Parent.Parent.Parent:FindFirstChild("Menu").Enter.LocalScript
function onClicked(GUI)
LS.Disabled = false
pic.Image = "http://www.roblox.com/asset/?id=209567993"
n.Text = "Tatooine: Mos Eisley"
info.Text = "'Mos Eisley Spaceport. You will never find a more wretched hive of scum and villainy. We must be cautious.' - Ben Kenobi to Luke Skywalker"
place.Value = 191123707
end
script.Parent.MouseButton1Click:connect(onClicked)

1 comment
Thank you, sir! The :WaitForChild function seems to work really well.