|
| 01 Mar 2013 07:42 PM |
I made a script that when it is activated, it will spawn a small brick that could be used for a multitude of things. It wasnt very hard to make, and I'm not happy with it just as a script, so I decided i wanted it in a GUI. I know how to make a GUI, but I have no clue as to how to get this script:
Part = Instance.new( "Part") Part.Parent = workspace Part.BrickColor = BrickColor.new("Institutional White") Part.Material = Enum.Material.Plastic Part.Reflectance = 0 Part.Transparency = 0 Part.Name = "Scripted Part" Part.Anchored = false Part.CanCollide = true Part.Elasticity = 0.5 Part.Friction = 0.30000001192093 Part.Shape = Enum.PartType.Block Part.formFactor = Enum.FormFactor.Symmetric Part.Size = Vector3.new(1, 1, 1) Part.CFrame = CFrame.new() Part.BackSurface = Enum.SurfaceType.Smooth Part.BottomSurface = Enum.SurfaceType.Smooth Part.FrontSurface = Enum.SurfaceType.Smooth Part.LeftSurface = Enum.SurfaceType.Smooth Part.RightSurface = Enum.SurfaceType.Smooth Part.TopSurface = Enum.SurfaceType.Smooth
. into a GUI and work every time I click the button. What I'm planning on doing is tearing apart one of the "Stamper" spin-offs and seeing how that GUI is set up. If you could tell me that would be great, if not, it's ok because I would figure it out eventually, every one does. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 01 Mar 2013 07:49 PM |
script.Parent.MouseButton1Click:connect(function() -- in the button -- code to create part end)
http:///wiki.roblox.com/index.php/MouseButton1Click_(Event)
|
|
|
| Report Abuse |
|
|
|
| 01 Mar 2013 07:55 PM |
so it would look like this?
script.Parent.MouseButton1Click:connect(function() Part = Instance.new( "Part") Part.Parent = workspace Part.BrickColor = BrickColor.new("Institutional White") Part.Material = Enum.Material.Plastic Part.Reflectance = 0 Part.Transparency = 0 Part.Name = "Scripted Part" Part.Anchored = false Part.CanCollide = true Part.Elasticity = 0.5 Part.Friction = 0.30000001192093 Part.Shape = Enum.PartType.Block Part.formFactor = Enum.FormFactor.Symmetric Part.Size = Vector3.new(1, 1, 1) Part.CFrame = CFrame.new() Part.BackSurface = Enum.SurfaceType.Smooth Part.BottomSurface = Enum.SurfaceType.Smooth Part.FrontSurface = Enum.SurfaceType.Smooth Part.LeftSurface = Enum.SurfaceType.Smooth Part.RightSurface = Enum.SurfaceType.Smooth Part.TopSurface = Enum.SurfaceType.Smooth end) |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 01 Mar 2013 07:57 PM |
| Yup, just make sure that's in a script in either a TextButton, or ImageButton. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2013 08:28 PM |
| k, thx, it will be in an image button |
|
|
| Report Abuse |
|
|