Really confusing issue with variables

im creating a localscript which is within a tool that aims to handle firing remotes, while defining variables ive been consistently getting the issue “attempt to index nil with ‘X’”
im aware that means that the script is indexing nothing with ‘X’ but i just cant get my head around why not, everything seems fine, like the hierarchy and defining of other variables.

the specific four lines that are giving me errors are in the attached screenshot, and ive tried using :FindFirstChild and :WaitForChild but they all yield the same error in the output
if you need anything like my output, or hierarchy then let me know as you might need to be made aware in order to better understand the issue

Try local character = player.Character or player.CharacterAdded:Wait() instead of just player.Character.

1 Like

completely disregard what i just said it turns out that actually didnt fix the issue

i am getting the error "handlerfolder is not a valid member of Model “Workspace.10festive11”

im gonna try increasing the time it takes for the player to be parented to the Alive folder then try something ill let you know

yeah im really not sure, i have a folder to determine who is alive in the workspace and who is dead, but i dont really know if that correlates to this issue

the error that is printing is “handlerfolder is not a valid member of Model “Workspace.10festive11” - Client - fireserver:7”

i made sure there is no delay to parent the character to the alive folder but that didn’t change anything
adding a wait to the CharacterAdded:Wait() didn’t fix it either
not really sure what to do right now

This problem has nothing to do with the player.CharacterAdded:Wait() as that isn’t throwing the error. The error is saying that it can’t find a "handlerfolder", so you should probably try local handler = character:WaitForChild("handlerfolder")

2 Likes

thanks for that it seemed to fix the issue, have a good day

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.