Hello. My first question.
So... I can't wrap my head around this...
local Player = game.Players.LocalPlayer
local GeigerGUI = Player.PlayerGui:FindFirstChild("GeigerCounter")
script.Parent.Equipped:Connect(function(Equip)
GeigerGUI.Enabled = true
end)
script.Parent.Unequipped:Connect(function(UnEquip)
GeigerGUI.Enabled = false
end)
Gives out the error:
23:36:05.477 - Players.rs1n1.Backpack.GeigerCounter.LocalScript:5: attempt to index upvalue 'GeigerGUI' (a nil value)
I have no idea why this happens.
This is in a local script. The GUI does exist.
LocalScripts can't detect if a tool is equipped? I remember using them for something like this not a long time ago.
Also, the files the things I'm messing with are in: https://imgur.com/a/WO3lv7L
Any ideas? Plz.

1 comment
Yes it indeed worked after I used WaitForChild(). Thank you so much!