|
| 09 Mar 2014 10:39 AM |
Player = script.Parent.Parent mouse = Player:GetMouse()
function Clone(key) if key == "f" then player = script.Parent.Parent if player.PlayerGui.mana.TextButton.Size.X.Scale >= 0.2 then player.PlayerGui.mana.TextButton.Size = player.PlayerGui.mana.TextButton.Size - UDim2.new(0.3,0,0,0) x = Player.Character:clone() print("cloned") x:MoveTo(script.Parent.Parent.Character.Torso.CFrame*CFrame.new(0,0,-6)) x.Name = "Bot" o = Instance.new("StringValue", x.Torso) o.Name = "Bot" i = Instance.new("StringValue", x.Torso) i.Value = script.Parent.Parent.Name k = workspace.BotScript:clone() k.Parent = x.Torso k.Disabled = false p = Instance.new("Part", workspace) p.Size = 0.2,35,35 p.Transparency = 1 p.Name = "Detector" end end end
mouse.KeyDown:connect(Clone)
08:35:30.354 - Players.Player1.Backpack.CloneScript:11: attempt to index global 'x' (a nil value) 08:35:30.355 - Script 'Players.Player1.Backpack.CloneScript', Line 11 08:35:30.355 - stack end 08:35:30.356 - Disconnected event because of exception
WTF????? I SAID X IS THE CLONE OF THE CHARACTER!!!!!! WHY?!?!?!?!? |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
|
| 09 Mar 2014 10:40 AM |
| You need to parent it first i think. |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2014 10:41 AM |
| ......didn't think of that. |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Mar 2014 10:45 AM |
Player = script.Parent.Parent mouse = Player:GetMouse()
function Clone(key) if key == "f" then player = script.Parent.Parent if player.PlayerGui.mana.TextButton.Size.X.Scale >= 0.2 then player.PlayerGui.mana.TextButton.Size = player.PlayerGui.mana.TextButton.Size - UDim2.new(0.3,0,0,0) x = Player.Character:clone().Parent = Workspace print("cloned") x:MoveTo(script.Parent.Parent.Character.Torso.CFrame*CFrame.new(0,0,-6)) x.Name = "Bot" o = Instance.new("StringValue", x.Torso) o.Name = "Bot" i = Instance.new("StringValue", x.Torso) i.Value = script.Parent.Parent.Name k = workspace.BotScript:clone() k.Parent = x.Torso k.Disabled = false p = Instance.new("Part", workspace) p.Size = 0.2,35,35 p.Transparency = 1 p.Name = "Detector" end end end
mouse.KeyDown:connect(Clone) |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
| |
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 09 Mar 2014 10:46 AM |
| The player's character model's "Archivable" property is set to false. This prevents it being cloned, so 'x' is nil. You therefore need to change this property to true before cloning. |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
|
| 09 Mar 2014 10:47 AM |
Warspy you cant do this: x=game.Workspace.Part:Clone().Parent = game.Workspace
But, you can do these: x=game.Workspace.Part:Clone() x.Parent = game.Workspace OR game.Workspace.Part:Clone().Parent = game.Workspace |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2014 10:48 AM |
| thank you. that bug is gone. Now a new one is here -_- |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2014 10:48 AM |
Player = script.Parent.Parent mouse = Player:GetMouse()
function Clone(key) if key == "f" then player = script.Parent.Parent char = Player.Character char.Archivable = true if player.PlayerGui.mana.TextButton.Size.X.Scale >= 0.2 then player.PlayerGui.mana.TextButton.Size = player.PlayerGui.mana.TextButton.Size - UDim2.new(0.3,0,0,0) x = char:clone().Parent = Workspace print("cloned") x:MoveTo(script.Parent.Parent.Character.Torso.CFrame*CFrame.new(0,0,-6)) x.Name = "Bot" o = Instance.new("StringValue", x.Torso) o.Name = "Bot" i = Instance.new("StringValue", x.Torso) i.Value = script.Parent.Parent.Name k = workspace.BotScript:clone() k.Parent = x.Torso k.Disabled = false p = Instance.new("Part", workspace) p.Size = 0.2,35,35 p.Transparency = 1 p.Name = "Detector" end end end
mouse.KeyDown:connect(Clone)
|
|
|
| Report Abuse |
|
|
|
| 09 Mar 2014 10:50 AM |
Player = script.Parent.Parent mouse = Player:GetMouse()
function Clone(key) if key == "f" then player = script.Parent.Parent if player.PlayerGui.mana.TextButton.Size.X.Scale >= 0.2 then player.PlayerGui.mana.TextButton.Size = player.PlayerGui.mana.TextButton.Size - UDim2.new(0.3,0,0,0) x = Player.Character:clone() print("cloned") x:MoveTo(script.Parent.Parent.Character.Torso.CFrame*CFrame.new(0,0,-6)) x.Name = "Bot" o = Instance.new("StringValue", x.Torso) o.Name = "Bot" i = Instance.new("StringValue", x.Torso) i.Value = script.Parent.Parent.Name k = workspace.BotScript:clone() k.Parent = x.Torso k.Disabled = false p = Instance.new("Part", workspace) p.Size = 0.2,35,35 p.Transparency = 1 p.Name = "Detector" end end end
mouse.KeyDown:connect(Clone)
08:50:08.861 - Unable to cast CoordinateFrame to Vector3 08:50:08.862 - Script 'Players.Player1.Backpack.CloneScript', Line 13 08:50:08.864 - stack end 08:50:08.866 - Disconnected event because of exception |
|
|
| Report Abuse |
|
|