This script is supposed to detect when a descendant is added to the player (so a Flashlight is picked up in this case) However I get this error: 20:13:54.253 - Players.Player1.PlayerGui.Objectives.Frame.Checker:7: attempt to index global 'decendant' (a nil value)
Anyone know why?
player = game.Workspace:WaitForChild(game.Players.LocalPlayer.Name)
s = script.Parent
player.DescendantAdded:connect(function(descendant)
if decendant.Name == "Flashlight" then
for i = 0,1,0.03 do
s.ObjectiveText.TextTransparency = i
s.ObjectiveTitle.TextTransparency = i
s.TextLabel.TextTransparency = i
end
end
end)

2 comments
Aha thats kinda awkward. Thanks!
No problem, we all do it sometimes.