|
| 02 Oct 2012 11:42 AM |
x = Instance.new("Part") x.Parent = game.Workspace Is there something wrong with that because when i put it into a script it doesn't insert a part. Please help! |
|
|
| Report Abuse |
|
|
|
| 02 Oct 2012 11:47 AM |
Looks fine to me... Try anchoring it, maybe?
------------------------- ~thedestroyer115, nice and helpful posts- sometimes~
|
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 02 Oct 2012 12:00 PM |
Position it.
Position = Vector3.new(0,10,0) |
|
|
| Report Abuse |
|
|
| |
|
nairod7
|
  |
| Joined: 26 Mar 2010 |
| Total Posts: 869 |
|
|
| 02 Oct 2012 12:17 PM |
x = Instance.new("Part") x.Parent = game.Workspace
This insert a part but it may fall, so as thedestroyer115 and Fedorakid said above, anchor it and change it's position:
x = Instance.new("Part") x.Parent = game.Workspace x.Position = Vector3.new(0, 10, 0) x.Anchored = true
By the way, you can remove this line ("x.Parent = game.Workspace") and enter the location ( workspace ) directly in the instance:
x = Instance.new("Part", game.Workspace)
...and the next...:
x.Position = Vector3.new(0, 10, 0) x.Anchored = true
|
|
|
| Report Abuse |
|
|
|
| 02 Oct 2012 12:17 PM |
Doing that creates an unanchored part at Position (0, 0, 0). Either of these might be reasons you aren't seeing the part:
local x = Instance.new("Part", workspace) x.Anchored = true
--one would normally use CFrame, but for the sake of simplicity I'll change the Position directly: x.Position = Vector3.new(0, 10, 0)
As you can see in the first line, you may also use the second parameter of Instance.new() to set the Parent of the object right after creation. c: |
|
|
| Report Abuse |
|
|
|
| 02 Oct 2012 12:42 PM |
| But i can't see it in workspace either. |
|
|
| Report Abuse |
|
|
nairod7
|
  |
| Joined: 26 Mar 2010 |
| Total Posts: 869 |
|
|
| 02 Oct 2012 12:54 PM |
| Do you know how to run a script ? Did you disable and enable the script to execute it ? |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Oct 2012 01:32 PM |
| I can only find disable, to enable to i click back off it? Because it still hasn't worked when i did that. |
|
|
| Report Abuse |
|
|
nairod7
|
  |
| Joined: 26 Mar 2010 |
| Total Posts: 869 |
|
|
| 02 Oct 2012 02:29 PM |
Yes. Try this script :
local part = Instance.new("Part", Game.Workspace) part.Anchored = true part.Position = Vector3.new(Game.Workspace.boxerboycool.Head.CFrame.p+Vector3.new(0, 10, 0)) |
|
|
| Report Abuse |
|
|