local Players = game:GetService("Players") local player = Players.LocalPlayer local character = player:FindFirstChild("Character") local KillStreak = script.Parent local Humanoid = character:FindFirstChild("Humanoid")
script.Parent = character:FindFirstChild("Torso")
Workspace.Part.BillboardGui.TextLabel.Script:3: attempt to index nil with 'Character' is what is says in the output
Anyone know why?
You tried referencing an object which doesn't exist.
The character's parent is in game.Workspace
.
The property 'Character' of a player object is the Player's Character so we can just do player.Character
We can use a repeat wait() until
for the Character to load
repeat wait() until player.Character local Players = game:GetService("Players") local player = Players.LocalPlayer local character = player.Character local KillStreak = script.Parent local Humanoid = character:FindFirstChild("Humanoid") script.Parent = character:FindFirstChild("Torso")
And btw, can you use the code block feature next time??