Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to fix attempt to index local "Player" (a nil value) line 3?

local Player = game.Players.LocalPlayer local player = game.Players:GetPlayerFromCharacter(char) local char = Player.Character local Character = Player.Character local RootPart = Character.HumanoidRootPart

1 answer

local Player = game.Players.LocalPlayer 
local player = game.Players:GetPlayerFromCharacter(char) 
local char = Player.Character
local Character = Player.Character 
local RootPart = Character.HumanoidRootPart

If you're trying to address game.Players.LocalPlayer, then you need to be using a LocalScript

This discussion is preserved as it was. New answers, comments, and votes are closed.