dino2306
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 1964 |
|
|
| 20 Mar 2011 06:03 AM |
When i tried this in a local script (in a tool)
function onButton1Down(mouse) Brick = Tool.Handle:Clone() Brick.Size = Vector3.new(4,4,4) Brick.Position = mouse.Target.Position Tool:Remove() end
it crashes Does anyone know wy? (i think its about the Brick.Position line but im not sure) No output , roblox gives the "unexpected error need to quit" message |
|
|
| Report Abuse |
|
|
dino2306
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 1964 |
|
|
| 20 Mar 2011 06:05 AM |
Oh , its supposed to place the brick on top of the brick you clicked (Moving it to the position of the clicked brick) |
|
|
| Report Abuse |
|
|
shouksta
|
  |
| Joined: 01 Dec 2009 |
| Total Posts: 1906 |
|
|
| 20 Mar 2011 06:19 AM |
| no connection and you haven't defined tool |
|
|
| Report Abuse |
|
|
dino2306
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 1964 |
|
|
| 20 Mar 2011 06:23 AM |
@Shouk 1 That would error , not crash roblox 2 How would it ever run without connection >.> im not giving the whole script , ive checked that part and that doesnt error |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
shouksta
|
  |
| Joined: 01 Dec 2009 |
| Total Posts: 1906 |
|
|
| 20 Mar 2011 07:01 AM |
| Was just checking you haven't missed out the obvious |
|
|
| Report Abuse |
|
|
rossb654
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1980 |
|
|
| 20 Mar 2011 07:26 AM |
| Try Brick.CFrame not Brick.Position |
|
|
| Report Abuse |
|
|
dino2306
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 1964 |
|
|
| 20 Mar 2011 09:37 AM |
@Ross if i use that it can happen bricks get stuck in eachother wit.position it will move ontop of the brick |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 20 Mar 2011 09:43 AM |
Roblox sometimes - most of the time - has bugs which will crash your place. In this script however, I doubt there is any code which should let Roblox crash, but since this happened - It is most likely a bug of some sort.
Also if you have used a free model, someone probably injected a script which crashes the game. |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2011 10:21 AM |
try it:
local Tool = script.Parent
function onButton1Down(mouse) Brick = Tool.Handle:Clone() Brick.Size = Vector3.new(4,4,4) Brick.CFrame = CFrame.new(mouse.Hit.p.x, mouse.Hit.p.y, mouse.Hit.p.z) Tool:Remove() end
function onEquipped(mouse) mouse.Icon = "http://www.roblox.com/asset/?id=1000000" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Equipped:connect(onEquipped)
|
|
|
| Report Abuse |
|
|
|
| 20 Mar 2011 10:24 AM |
| the .cframe is the new position of the brick you need it or it wont work |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2011 10:25 AM |
local Tool = script.Parent
function onButton1Down(mouse) Brick = Tool.Handle:clone() Brick.Size = Vector3.new(4,4,4) Brick.CFrame = CFrame.new(mouse.Hit.p.x, mouse.Hit.p.y, mouse.Hit.p.z) Tool:Remove() end
function onEquipped(mouse) mouse.Icon = "http://www.roblox.com/asset/?id=1000000" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Equipped:connect(onEquipped)
now it will work for you |
|
|
| Report Abuse |
|
|
dino2306
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 1964 |
|
| |
|
| |
|
dino2306
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 1964 |
|
| |
|
| |
|
dino2306
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 1964 |
|
|
| 20 Mar 2011 01:37 PM |
Aha! You cant remove a script when still in a function I got it fixed by using an ouside remove script thanx for everyone who tried helping! |
|
|
| Report Abuse |
|
|