Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 02 Jul 2013 08:36 AM |
mouse.Target.Character?
God I hate going figuring out these hierarchy |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 08:45 AM |
| http://www.youtube.com/watch?v=TgDRMCvdSI0 |
|
|
| Report Abuse |
|
|
Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 02 Jul 2013 08:53 AM |
| Not really a big help because the script I needed isn't provided. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 09:19 AM |
I would say mouse.Target.Parent, but I'm not 100% sure.
|
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 09:27 AM |
Awesomeness is correct, but you still need to check for it.
if mouse and mouse.Target and mouse.Target.Parent:FindFirstChild("Humanoid") then plr = game.Players:GetPlayerFromCharacter(mouse.Target.Parent) end |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 09:32 AM |
@above
Yep.
I assumed that he would do that himself, but thanks for posting that anyway :) |
|
|
| Report Abuse |
|
|
Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 02 Jul 2013 09:32 AM |
I had a feeling I needed parent. Can I use :IsA? To check if its also a model.
Question, I never studied GetPlayerFromCharacter, but what does It exactly do and what did you do? |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 09:34 AM |
game.Players:GetPlayerFromCharacter(CHARACTERHERE)
What it does is get the player that is controlling the character.
For example:
game.Players:GetPlayerFromCharacter(workspace:FindFirstChild("TheAwesomenessDude")
^ That would return my player. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 09:35 AM |
Oops, forgot the closing bracket at the end.
Also, checking if the character is a model would work, however if you had other models in your game, the script would think they are character's as well, so it is not recommended. |
|
|
| Report Abuse |
|
|
Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 02 Jul 2013 09:37 AM |
What exactly is that needed for?
Also, yeah ik. It's just a test. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 09:40 AM |
GetPlayerFromCharacter?
Well, let's say you wanted to insert an admin GUI when someone stepped on a part.
You would first get their character from the Touched event, right?
But their PlayerGui is inside of their player, not their Character.
So you would need to use GetPlayerFromCharacter() to get the player, and then find the PlayerGui from inside that, and then finally clone the admin GUI from lighting (or wherever you have it), and put it inside the PlayerGui.
All from the touch of a brick. |
|
|
| Report Abuse |
|
|
Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 02 Jul 2013 09:42 AM |
| Omg. It all makes sense to me now. I thought 'twas useless. Shanks :3 |
|
|
| Report Abuse |
|
|