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

Help can't get character players ??

I'm trying to get the player's character.

local player = game.Players:WaitForChild("LocalPlayer") -- Wait for player join
local char = player:WaitForChild("Character") -- Wait for character add

char.HumanoidRootPart.CFrame = CFrame.new(100, 500, 136)

2 comments

0

Btw it's a Localscript

0

Yea, you have to use a localscript for stuff like local player

1 answer

Can't get the LocalPlayer like that. The character either. Two ways to get the character , first get the player

local players = game:GetService("Players")
local plr = players.LocalPlayer or players.PlayerAdded:Wait()
local char = plr.Character or plr.CharacterAdded:Wait() 

char.HumanoidRootPart.CFrame = CFrame.new(100,500,136)

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