generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Most effective way to get Character from LocalPlayer?

Previous Thread :: Next Thread 
jbjgang2 is not online. jbjgang2
Joined: 07 Feb 2010
Total Posts: 8948
26 Sep 2015 06:06 PM
Title^
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
26 Sep 2015 06:06 PM
uh. indexing the character property?

-=Robo=-
Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
26 Sep 2015 06:06 PM
uh. indexing the character property? [2]
Report Abuse
jbjgang2 is not online. jbjgang2
Joined: 07 Feb 2010
Total Posts: 8948
26 Sep 2015 06:09 PM
in a local script
Report Abuse
DeathsLASTwords is not online. DeathsLASTwords
Joined: 28 Jan 2012
Total Posts: 2701
26 Sep 2015 06:29 PM
local player = game.Players.LocalPlayer
local character = player.Character

im confused if this is what you want?


Deaths, Forum Helper
Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
26 Sep 2015 06:37 PM
>in a local script
uh. indexing the character property? [3]
Report Abuse
jbjgang2 is not online. jbjgang2
Joined: 07 Feb 2010
Total Posts: 8948
27 Sep 2015 09:44 AM
thats not the most effective way

it would error if the character hasn't been created
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
27 Sep 2015 09:45 AM
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:wait();


Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784
Report Abuse
notfruit is not online. notfruit
Joined: 21 Sep 2012
Total Posts: 1386
27 Sep 2015 09:46 AM
game.Players.PlayerAdded:connect(function (player)
player:CharacterAdded:connect(function (character)
-- do whatever you want with the character
-- this is literally on the wiki
end)
end)
Report Abuse
notfruit is not online. notfruit
Joined: 21 Sep 2012
Total Posts: 1386
27 Sep 2015 09:46 AM
Oops, sorry. Didn't see the LocalPlayer.
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
27 Sep 2015 01:48 PM
no, it wouldn't.
if you index character and character is nil, it will read nil, it won't throw an error; character isn't a child, it's a property. hurr durr.

-=Robo=-
Report Abuse
iWindowz is not online. iWindowz
Joined: 05 Jan 2013
Total Posts: 1809
27 Sep 2015 02:02 PM
game.Players.LocalPlayer:WaitForChild("Character")?
o.e


i wrote this siggy just because i dont have a siggy
Report Abuse
iWindowz is not online. iWindowz
Joined: 05 Jan 2013
Total Posts: 1809
27 Sep 2015 02:02 PM
^nvm that it isn't an object
i am so stupid ;c


i wrote this siggy just because i dont have a siggy
Report Abuse
LuaAtrocities is not online. LuaAtrocities
Joined: 15 Jan 2012
Total Posts: 617
27 Sep 2015 02:12 PM
game.Players.LocalPlayer.Character?
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
27 Sep 2015 03:33 PM
What's the point of posting unsure answers if I posted the answer already. :P
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image