DrJonJ
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 2361 |
|
|
| 08 Mar 2015 09:40 PM |
[code]local character = player:WaitForChild(player.Character)[/code]
Will that work, or will it pass because the PROPERTY is there. Trying to simplify waiting for the character. |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 08 Mar 2015 09:42 PM |
i'm gonna assume english isn't your first language
local character = (Player.Character) or Player.CharacterAdded:wait()
-=Robo=- |
|
|
| Report Abuse |
|
|
DrJonJ
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 2361 |
|
|
| 08 Mar 2015 09:44 PM |
And I'm going to assume you don't know how to properly title a thread.
Also, if you're referring to the "[code]" I forgot the ROBLOX forums don't have BBCode. So used to RBXDev forums. |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 08 Mar 2015 09:56 PM |
I was going off your sentence structure. Chill.
-=Robo=- |
|
|
| Report Abuse |
|
|
DrJonJ
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 2361 |
|
|
| 08 Mar 2015 10:00 PM |
Out of curiosity, what makes you think that about the way my sentence is? Keep in mind that I'm not a kid typer. Or even a teenage typer for that matter.
I'm older than most users on this site, which may impact the way I type, and the way you see it due to a generational gap. |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 08 Mar 2015 10:05 PM |
Forgetting to use a question mark and lacking a sentence subject counts as not being an English native? I do both of those all the time o.O
|
|
|
| Report Abuse |
|
|
|
| 08 Mar 2015 10:05 PM |
"Instance WaitForChild ( string childName )"
> Google it > Ask on Rbx dev, if you are going to boast about how you are "so used to it".
Geez and you are on that forum.. |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2015 10:06 PM |
Or used Player.CharacterAdded
Ya I really wonder how you got on there. |
|
|
| Report Abuse |
|
|
DrJonJ
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 2361 |
|
|
| 08 Mar 2015 10:09 PM |
@Dark
Wait for child does take a String value, however I didn't bother to check if it could check objects. And for the record, I am more than likely more capable at scripting than you are.
And I did, but no one replied yet, as it's not nearly as active as these forums.
And almost EVERY forum out there uses BBCode, but I just made the exact same thread there so it was copy paste.
And I WOULD use PlayerAdded if I didn't need to use a LocalScript for the code this is for. |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 08 Mar 2015 10:15 PM |
I intended no offense, homie. I was just making assumptions. I'm 15, lol. I just read it as someone using translate, or something along the lines, didn't catch the primary group.
-=Robo=- |
|
|
| Report Abuse |
|
|
DrJonJ
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 2361 |
|
|
| 08 Mar 2015 10:16 PM |
You're fine. I was genuinely curious as to how it seem odd. :P |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2015 10:35 PM |
| It can't take objects, because it is nil (and you wait for that object to not be nil); that lacks logic.. |
|
|
| Report Abuse |
|
|
Poseidas
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 2659 |
|
|
| 09 Mar 2015 12:00 AM |
| RBXDev members still utilize these forums because they are helpful nonetheless. Seeing helpful and skilled people also gives us an opportunity to refer more members. Though a lot of members on the forum are elitists, please don't act like we have our noses raised to the ROBLOX forums. Come on. Anyway, no this won't work. To my knowledge, "WaitForChild" only takes strings. |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 09 Mar 2015 12:03 AM |
| you don't use the rbxdev forums to answer a simple question like this lol |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 09 Mar 2015 12:04 AM |
you should refer me homie ( ͡° ͜ʖ ͡°)
-=Robo=- |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 09 Mar 2015 12:11 AM |
| This page should have all the information you need: http://wiki.roblox.com/index.php?title=API:Class/Player/Character |
|
|
| Report Abuse |
|
|
Ripull
|
  |
| Joined: 21 Jul 2008 |
| Total Posts: 14249 |
|
|
| 09 Mar 2015 06:42 AM |
Most fool-proof way is to do:
local player = game.Players.LocalPlayer local Character = player.Character
repeat wait() until Character
I've used CharacterAdded:wait() in the past and ran into some problems with it, so I'm fine using the above method. |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 09 Mar 2015 01:17 PM |
The only problem, to my knowledge, that you can occasionally run into with CharacterAdded:wait(), is the player leaving the game. As far as I can tell, repeating a wait for the character isn't much different, lol -=Robo=- |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 09 Mar 2015 01:18 PM |
also, not meaning to correct you, because i'm not sure I'm right would you have to do repeat wait() until Player.Character? beings, if the character was nil when defined to the variable, it wouldn't change.
-=Robo=- |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
| |
|
anaIyze
|
  |
| Joined: 29 May 2014 |
| Total Posts: 2048 |
|
| |
|
DrJonJ
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 2361 |
|
|
| 09 Mar 2015 01:20 PM |
It's like doing this:
Script 1:
_G.Player
repeat wait() until _G.Player print(_G.Player)
Script 2:
wait(2) _G.Player = 1
(after two seconds) ---> 1 |
|
|
| Report Abuse |
|
|
anaIyze
|
  |
| Joined: 29 May 2014 |
| Total Posts: 2048 |
|
| |
|
|
| 09 Mar 2015 01:29 PM |
| and I'm still wondering how I haven't gotten into RBXDev |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 09 Mar 2015 01:30 PM |
analyze is a tryhard who thinks he's better than recognized elites of the community inb4 he breaks down saying he's older than us and he has lots of friends -=Robo=- |
|
|
| Report Abuse |
|
|