|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 29 Apr 2013 06:50 PM |
try putting the TC = Target:Clone() line into the Function itself |
|
|
| Report Abuse |
|
|
|
| 29 Apr 2013 06:51 PM |
:FindFirstChild isn't a built-in function. It's correctly used :findFirstChild()
#YourMother |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|