Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Confusing Script Error (attempt to index a nil value?) (SOLVED)

Asked by 6 years ago
Edited 6 years ago

Hello fellow coders! I've had a run in with ROBLOX's system. For some reason, when I use local scripts within filtering-enabled, it cannot find certain instances, that for one, are obviously there! I've tried to find the instance via LocalPlayer.PlayerGui blah blah and also doing script.Parent, etc. What have I done wrong?

(screenshots here)

https://gyazo.com/f1bf2e1092b1b23004945e71f75fe661

(as you can see, the instance MF is clearly in there, but for some reason, the script can't access it!)

~~~~~~~~~~~~~~~~~ (code) local player = game.Players.LocalPlayer local nameColor = BrickColor.new(colors[math.random(1, #colors)]).Color local messageColor = BrickColor.new('Institutional white').Color local mf = script.Parent:FindFirstChild("mf") local messageBox = mf:WaitForChild('InputFrame'):FindFirstChild('MessageBox') local UIS = game:GetService('UserInputService') local event = game:GetService('ReplicatedStorage'):WaitForChild('Chatted') ~~~~~~~~~~~~~~~~~

1
Try a :WaitForChild. GuiObjects are one of those objects that don’t instantly load when the game starts. User#19524 175 — 6y
0
I have fixed it! Thank you, icapaz! RandomlyAiden 0 — 6y

Answer this question