local uis = game:GetService("UserInputService") local anim = Instance.new("Animation") local p = game.Players.LocalPlayer local c = p.Character local h = c:WaitForChild("Humanoid") if h then print("H") end
it doesn't print in the output h but it says that c is a nil value how can i solve this?
local c = p.Character or p.CharacterAdded:Wait()
local c = p.Character
returned nil
because character wasnt loaded, if you add or p.CharacterAdded:Wait()
then if p.Character
returns nil
it will wait til character loads