generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Wy does this crash ROBLOX?

Previous Thread :: Next Thread 
dino2306 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
20 Mar 2011 06:58 AM
[ Content Deleted ]
Report Abuse
shouksta is not online. 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 is not online. rossb654
Joined: 19 Oct 2008
Total Posts: 1980
20 Mar 2011 07:26 AM
Try Brick.CFrame not Brick.Position
Report Abuse
dino2306 is not online. 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 is not online. 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
ArmyModder is not online. ArmyModder
Joined: 13 Feb 2010
Total Posts: 45
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
ArmyModder is not online. ArmyModder
Joined: 13 Feb 2010
Total Posts: 45
20 Mar 2011 10:24 AM
the .cframe is the new position of the brick you need it or it wont work
Report Abuse
ArmyModder is not online. ArmyModder
Joined: 13 Feb 2010
Total Posts: 45
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 is not online. dino2306
Joined: 18 Aug 2009
Total Posts: 1964
20 Mar 2011 10:30 AM
@Army
ill try
Report Abuse
ArmyModder is not online. ArmyModder
Joined: 13 Feb 2010
Total Posts: 45
20 Mar 2011 10:41 AM
ok
Report Abuse
dino2306 is not online. dino2306
Joined: 18 Aug 2009
Total Posts: 1964
20 Mar 2011 11:05 AM
Still failz
Report Abuse
ArmyModder is not online. ArmyModder
Joined: 13 Feb 2010
Total Posts: 45
20 Mar 2011 11:22 AM
ok
Report Abuse
dino2306 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image