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: Help me with a basic script.

Previous Thread :: Next Thread 
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:25 PM
Here's the script:
local p = Instance.new("SpawnLocation")
p.BrickColor = BrickColor.new("Bright orange")
p.Name = "Wobbly"
p.Parent = game.Workspace
p.FormFactor = "Plate"
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.Size = Vector3.new(18, 0.1, 18)
p.Material = "Wood"
p.Locked = false
p.Anchored = true
p.Position = Vector3.new((math.random(-500, 500)),500,(math.random(-500,500)))

--Basically i would like a script going inside 'p' part and with a line inside the script saying:
script.Parent.BodyPosition.position = script.Parent.Position
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:26 PM
I'll offer a prize including RRRRRRRRRR$$$$$ :)
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:28 PM
Anyone????????????
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:30 PM
Cmon guys..
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
15 Aug 2013 03:31 PM
Just keep the script you want in p in Lighting or something. Then just add this to your script: game.Lighting.pScript:Clone().Parent = p
Report Abuse
IAmReallyAwesome is not online. IAmReallyAwesome
Joined: 05 Mar 2010
Total Posts: 7371
15 Aug 2013 03:31 PM
local p = Instance.new("SpawnLocation")
p.BrickColor = BrickColor.new("Bright orange")
p.Name = "Wobbly"
p.Parent = game.Workspace
p.FormFactor = "Plate"
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.Size = Vector3.new(18, 0.1, 18)
p.Material = "Wood"
p.Locked = false
p.Anchored = true
p.Position = Vector3.new((math.random(-500, 500)),500,(math.random(-500,500)))
local b = Instance.new("BodyPosition", p)
b.Position = p.Position

--Why not just do that

*Tell me about the rabbits, George*
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:32 PM
Thanks for the reply. But I mean I want it to work in script builder, I need a script inside the brick saying that line. Just like a normal model. But a part with a script in it? Help please.
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:33 PM
Nice idea but I really need to know how to put a script into the brick and a script inside it. trying to figure out how.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
15 Aug 2013 03:33 PM
local p = Instance.new("SpawnLocation")
p.BrickColor = BrickColor.new("Bright orange")
p.Name = "Wobbly"
p.Parent = game.Workspace
p.FormFactor = "Plate"
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.Size = Vector3.new(18, 0.1, 18)
p.Material = "Wood"
p.Locked = false
p.Anchored = true
p.Position = Vector3.new((math.random(-500, 500)),500,(math.random(-500,500)))
local a = game.Lighting.Script:clone --JOLAGAJGPOAJGPOGPJGGJAJG There you read it.
a.Parent = p -- Make the script go into the lighting.
local b = Instance.new("BodyPosition", p)
--If I understood you correctly, this would work.
Report Abuse
mrwar117 is not online. mrwar117
Joined: 16 Oct 2009
Total Posts: 224
15 Aug 2013 03:34 PM
local p = Instance.new("SpawnLocation")
p.BrickColor = BrickColor.new("Bright orange")
p.Name = "Wobbly"
p.Parent = game.Workspace
p.FormFactor = "Plate"
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.Size = Vector3.new(18, 0.1, 18)
p.Material = "Wood"
p.Locked = false
p.Anchored = true
p.Position = Vector3.new((math.random(-500, 500)),500,(math.random(-500,500)))
game.Workspace.Script:clone().Parent = p
game.Workspace.p.Script.Disabled = false

Then make a seperate script in the workspace thats disabled, and put this inside it :
script.Parent.BodyPosition.position = script.Parent.Position

Boom problem solved
Report Abuse
mrwar117 is not online. mrwar117
Joined: 16 Oct 2009
Total Posts: 224
15 Aug 2013 03:36 PM
Sorry i replyed too late, Idk ive never played script builder
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:37 PM
I dunno if you guys understand. I can't clone a script into my brick if I can't get a line into the script. Thanks anyway but you know i'm trying to do this look:

local p = Instance.new("SpawnLocation")
p.BrickColor = BrickColor.new("Bright orange")
p.Name = "Wobbly"
p.Parent = game.Workspace
p.FormFactor = "Plate"
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.Size = Vector3.new(18, 0.1, 18)
p.Material = "Wood"
p.Locked = false
p.Anchored = true
p.Position = Vector3.new((math.random(-500, 500)),500,(math.random(-500,500)))
function script()
SCRIPT HERE
end

So it goes inside the brick a script.
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:39 PM
Please help. For a example if I wanted to make a button. How would I do it. How can I put a script inside the brick that has a line it? Without cloning anything. so it works in script builder or something?
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:40 PM
Cmon guys I've been trying to do it for a long time..
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
15 Aug 2013 03:42 PM
So you want to Instance a script and then edit the content with a script. Impossible, sorry.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
15 Aug 2013 03:43 PM
You have to clone it.
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
15 Aug 2013 03:44 PM
The only way you could insert text into the script is with loadstring(script.Code.Value)() but that would mean there would have to be code already in the script.
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:45 PM
Ok thanks guys solved now.
Report Abuse
IAmReallyAwesome is not online. IAmReallyAwesome
Joined: 05 Mar 2010
Total Posts: 7371
15 Aug 2013 03:45 PM
I suppose you could use Global variables...

*Tell me about the rabbits, George*
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 03:51 PM
What ya mean?
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
15 Aug 2013 03:52 PM
_G.variable = 1
Report Abuse
brt5586 is not online. brt5586
Joined: 09 Jan 2009
Total Posts: 277
15 Aug 2013 04:12 PM
local p = Instance.new("SpawnLocation", game.Workspace)
p.BrickColor = BrickColor.new("Bright orange")
p.Name = "Wobbly"
p.FormFactor = "Plate"
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.Size = Vector3.new(18, 0.1, 18)
p.Material = "Wood"
p.Locked = false
p.Anchored = true
p.Position = Vector3.new((math.random(-500, 500)),500,(math.random(-500,500)))
local b = Instance.new("BodyPosition", p)
b.Position = p.Position
b.Parent = p
b.D = 125000
b.maxForce = Vector3.new(400000, 400000, 400000)
b.P = 100000
local bg = Instance.new("BodyGyro", p)
bg.Parent = p
bg.D = 2
bg.maxTorque = Vector3.new(400000, 0, 400000)
bg.P = 1

--BodyGyro Doesn't show up may anyone fix it to work like a wobbling plate in SFOTH
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