|
| 01 Sep 2015 09:05 PM |
I need some help with the location of spawning a part on a player.
Currently it is spawning in the torso.
local plr = script.Parent.Parent.Parent.Parent.Parent.Character -- basically player with username x
Y.Part0 = plr.Torso -- I want to spawn this part in the right leg, but I'm not sure how to do it. plr["Right Leg"] does not work because apparently it's not the name of the part.
In addition, this is a Gui morph so I am using onClicked instead of OnTouched. |
|
|
| Report Abuse |
|
|
georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
|
| 01 Sep 2015 09:17 PM |
"In addition, this is a Gui morph so I am using onClicked instead of OnTouched." Wouldn't it be a MouseButton1Down? |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2015 09:27 PM |
I have no idea. I'm new to scripting. My friend helped me with most of this, but she's offline now. ^^;
onClicked worked with the torso and the legs, except that the legs aren't being cloned where I want them to be, and they have to be connected to the player's legs to get the animation. |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2015 09:30 PM |
It is MouseButton1Down, or alternatively, InputEnded. Use a localscript, and then game.Players.LocalPlayer.Character is the player, and it is named Right Leg.
Lord of all things, breaded and unbreaded. |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2015 09:40 PM |
I tried, but I can't figure out where I went wrong with that.
local RightLeg = game.Players.LocalPlayer.Character:findFirstChild("Right Leg")
That's one way to find that specific part since it has a space in it, correct?
However, I don't know how to implement said local, as I don't know what its parent should be.
Y.Part0 = Rightleg -- incorrect |
|
|
| Report Abuse |
|
|
georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
|
| 01 Sep 2015 09:41 PM |
| Just make the script a localscript |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2015 09:46 PM |
You can also use Character["Right Leg"] To make it local, use a LocalScript object instead of a Script object.
Lord of all things, breaded and unbreaded. |
|
|
| Report Abuse |
|
|
georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
|
| 01 Sep 2015 09:47 PM |
| I personally prefer LocalScripts, as most of my scripts need to access the player easily. I just think it is easier |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2015 09:50 PM |
Oh!
I got it to work. Thank you both so much! |
|
|
| Report Abuse |
|
|