|
| 09 Aug 2013 09:33 PM |
I'm missing what? --30 something lines down. function SwitchCharacter() local tank = Vehicles[SelectedVehicle]:GetChildren() tank:clone() --ERROR. tank.Parent = plr.Character tank:MoveTo(game:GetService("Workspace"):FindFirstChild("BasePads")[plr:findFirstChild("BaseID").Value].Position) tank:MakeJoints() tank.Main_Script.Disabled = false tank:GetChildren().Parent = plr.Character end
21:31:49.691 - Players.Player2.PlayerGui.LoadOutScreen.LocalScript:12: attempt to call method 'clone' (a nil value) 21:31:49.694 - Script "Players.Player2.PlayerGui.LoadOutScreen.LocalScript", Line 12 - global SwitchCharacter 21:31:49.695 - Script "Players.Player2.PlayerGui.LoadOutScreen.LocalScript", Line 33 21:31:49.695 - stack end 21:31:49.695 - Disconnected event because of exception |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 09:35 PM |
for i,v in pairs(tank) do v:clone() end
You have to have a for loop to clone multiple items. I think you mean tank = Vehicles[SelectedVehicle]. That's all you should need. Then it will clone perfectly.
Got a problem with me? Take it up with my butt because it's the only one that gives a crap. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 09:36 PM |
| You cannot clone a table that is returned by GetChildren. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 09:36 PM |
Late post. >_< Too busy looking at something on the Wiki.
Do what Ceaseless did. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 09:37 PM |
function SwitchCharacter() local tankParts = Vehicles[SelectedVehicle]:GetChildren() local newTank = Instance.new("Model") for Index, Child in pairs(tankParts) do Child:clone().Parent = newTank end newTank.Parent = plr.Character newTank:MoveTo(Workspace.BasePads.[plr.BaseID.Value].Position) newTank:MakeJoints() newTank.Main_Script.Disabled = false newTank.Parent = plr.Character end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Aug 2013 09:37 PM |
@AFF, I beat you for once! :D
Got a problem with me? Take it up with my butt because it's the only one that gives a crap. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 09:38 PM |
@Cease
This: _______________________________________
Iterations
Joined: 22 Jul 2013 Total Posts: 297 Skilled Scripters Re: :Clone() Nil? Posted: 08-09-2013 07:37 PM :( don't post before me |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 09:39 PM |
@AFF, what about it..?
Got a problem with me? Take it up with my butt because it's the only one that gives a crap. |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Aug 2013 09:40 PM |
Why not? You always posted before me.. You made me cry once, D:.
Got a problem with me? Take it up with my butt because it's the only one that gives a crap. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 09:41 PM |
Yeah, well. I was on Wiki. It wasn't fair. QQ |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 09:41 PM |
"You made me cry once"
woah man you can post before me |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 09:43 PM |
@AFF, umad?
Got a problem with me? Take it up with my butt because it's the only one that gives a crap. |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Aug 2013 09:45 PM |
I will com and eat you bro! What do you taste like? Milk chocolate, dark chocolate, or vanilla chocolate?
Got a problem with me? Take it up with my butt because it's the only one that gives a crap. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 09 Aug 2013 10:12 PM |
:D
Got a problem with me? Take it up with my butt because it's the only one that gives a crap. |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2013 12:25 PM |
| Thanks I'll keep this in mind. |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2013 12:33 PM |
function SwitchCharacter() local tank = Vehicles[SelectedVehicle]:GetChildren() tank:Clone() --ERROR. tank.Parent = plr.Character tank:MoveTo(game:GetService("Workspace"):FindFirstChild("BasePads")[plr:findFirstChild("BaseID").Value].Position) tank:MakeJoints() tank.Main_Script.Disabled = false tank:GetChildren().Parent = plr.Character end
Guest, you forgot to capitalize 'Clone()'. |
|
|
| Report Abuse |
|
|