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 » Game Design
Home Search
 

Re: Scripting Help Needed

Previous Thread :: Next Thread 
MysticalWhisper is not online. MysticalWhisper
Joined: 20 Jun 2011
Total Posts: 117
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 is not online. 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
MysticalWhisper is not online. MysticalWhisper
Joined: 20 Jun 2011
Total Posts: 117
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
GhostSailor is not online. GhostSailor
Joined: 02 Jul 2010
Total Posts: 1913
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
MysticalWhisper is not online. MysticalWhisper
Joined: 20 Jun 2011
Total Posts: 117
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 is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
01 Sep 2015 09:41 PM
Just make the script a localscript
Report Abuse
GhostSailor is not online. GhostSailor
Joined: 02 Jul 2010
Total Posts: 1913
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 is not online. 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
MysticalWhisper is not online. MysticalWhisper
Joined: 20 Jun 2011
Total Posts: 117
01 Sep 2015 09:50 PM
Oh!

I got it to work. Thank you both so much!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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