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 » Scripting Helpers
Home Search
 

Re: Spawning with armor

Previous Thread :: Next Thread 
mattandjeffhardy619 is not online. mattandjeffhardy619
Joined: 21 Jul 2008
Total Posts: 510
29 Apr 2013 06:19 PM
What I'm I doing wrong?

Target = game.Lighting:FindFirstChild("Armor")
TC = Target:Clone()

function onEntered(player)
TC.Parent = player.Character
TC.Position = Vector3.new(player.Character.Torso.Position)
* CFrame.new(1, 0, 0)
end

game.Players.PlayerAdded:connect(onEntered)
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
29 Apr 2013 06:35 PM
Wheres the Weld?
wheres the Armour(Torso's) Definition, to be placed at?
e.g; TC.Chest.Middle.Position =
Theres lots wrong with this coding tbh, Fix up this part, then I may continue :)
Report Abuse
mattandjeffhardy619 is not online. mattandjeffhardy619
Joined: 21 Jul 2008
Total Posts: 510
29 Apr 2013 06:36 PM
I was just going to mess around with the weld but the part won't clone into the player to start with so I cant do anything...
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
29 Apr 2013 06:50 PM
try putting the
TC = Target:Clone()
line into the Function itself
Report Abuse
jhend27513 is not online. jhend27513
Joined: 17 Sep 2011
Total Posts: 3369
29 Apr 2013 06:51 PM
:FindFirstChild isn't a built-in function. It's correctly used :findFirstChild()

#YourMother
Report Abuse
mattandjeffhardy619 is not online. mattandjeffhardy619
Joined: 21 Jul 2008
Total Posts: 510
29 Apr 2013 07:05 PM
Okay I worked on it a little more. It clones into the player now, but it is put in a random position nowhere near the character

Target = game.Lighting:findFirstChild("Armor")
TC = Target:Clone()

function onEntered(player)
p = player.Name
game.Workspace:WaitForChild(p)
TC.Parent = player.Character
TC.Position = Vector3.new(player.Character.Torso.Position)
* CFrame.new(1, 0, 0)
end

game.Players.PlayerAdded:connect(onEntered)
Report Abuse
mattandjeffhardy619 is not online. mattandjeffhardy619
Joined: 21 Jul 2008
Total Posts: 510
29 Apr 2013 07:10 PM
Okay, got it

Target = game.Lighting:findFirstChild("Armor")
TC = Target:Clone()

function onEntered(player)
p = player.Name
game.Workspace:WaitForChild(p)
TC.Parent = player.Character
TC.Position = CFrame.new(player.Character.Torso.Position)
* Vector3.new(1, 0, 0)
end

game.Players.PlayerAdded:connect(onEntered)

But there is a glitch in it, only one character can have it at a time and when they die the armor goes a way how do I fix that?
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
29 Apr 2013 07:15 PM
Try using the Died event (Do a wait(5) so the player has time to respawn)

The only problem is that when the player enters the game the first life they won't get the armor. So make a script that a second after they join the game they get killed.

Use the for the died event: http://wiki.roblox.com/index.php/Died_%28Event%29
Report Abuse
mattandjeffhardy619 is not online. mattandjeffhardy619
Joined: 21 Jul 2008
Total Posts: 510
29 Apr 2013 08:22 PM
I don't know how I would make it an ondied event, is there a way that I can make it like a body part so it just automatically spawns with the character.
Report Abuse
mattandjeffhardy619 is not online. mattandjeffhardy619
Joined: 21 Jul 2008
Total Posts: 510
29 Apr 2013 08:47 PM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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