WaitForChild not working

Oh sorry that line it outdated here:
local Character = Player:WaitForChild("Character")

LocalPlayer is non-nil in LocalScripts. There’s not enough context in the thread and it’s causing a bit of reply bloat to figure out your exact problem because the thread and the information you’re replying with is very vague, but this seems about appropriate.

local LocalPlayer = game:GetService("Players").LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()

If it’s in StarterCharacterScripts then you can just access the character with script.Parent, no need to do the long-winded way of fetching them from the Players service.

You need to explain your circumstances a whole lot more so we don’t have to pry information from you. Detail your case, share media, explain what type of scripts you’re using, show the exact error and relevant code (this is not enough code to determine an error source) and so on.

Also Character is a property, not a child. WaitForChild(“Character”) does not work.

nononononono just do something like this

local Player = game.Players.LocalPlayer
Player.CharacterAdded:wait()
local Character = Player.Character

its the same thing… besides its adding a extra line

1 Like

2 lines is better then 3 lines

1 Like

For some reason, it says:
Workspace.Rapideed.FireBallscript.Fireball:7: attempt to index nil with ‘Character’

just do
local char = script.Parent
local player = game.Players:GetPlayerFromCharacter(script.Parent)

1 Like

its a local script in startercharacterscripts so that will work

Here would be a version that would work with your code (if you wanted to use that code)

local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()