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: 2 questions

Previous Thread :: Next Thread 
Silvaspark978645 is not online. Silvaspark978645
Joined: 16 Nov 2013
Total Posts: 13
07 Dec 2013 02:13 PM
First Question :
What is the line of code to change color? i tried LOCALINSTANCEOFBRICK.Color = Vector3.new(255, 255, 255) but that didnt work. can someone please help?

Second Question:
When i do:
local brick = Instance.new("Part", workspace)
brick.Name = "Estro"
local script = Instance.new("Script", workspace.Estro)


how can i insert what the script is? what is the line of code for that?
do i have to make a base script than that is coped over everytime this is run? please help!
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
07 Dec 2013 02:15 PM
.Color = Color3.new(255,255,255)
Report Abuse
Silvaspark978645 is not online. Silvaspark978645
Joined: 16 Nov 2013
Total Posts: 13
07 Dec 2013 02:16 PM
Thanks! Anyone can help me with question 2?
Report Abuse
Silvaspark978645 is not online. Silvaspark978645
Joined: 16 Nov 2013
Total Posts: 13
07 Dec 2013 02:18 PM
Helpless Bump
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
07 Dec 2013 02:20 PM
I believe you can't make a script like that and then edit inside of it over the existing one. Maybe possible with loadstring()
Report Abuse
Silvaspark978645 is not online. Silvaspark978645
Joined: 16 Nov 2013
Total Posts: 13
07 Dec 2013 02:20 PM
Can you insert a script into a block then?
Report Abuse
Silvaspark978645 is not online. Silvaspark978645
Joined: 16 Nov 2013
Total Posts: 13
07 Dec 2013 02:21 PM
Using a diff Method
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
07 Dec 2013 02:22 PM
Yes, you can. It should work the way you did it.

p = Instance.new("Part", Workspace)
sc = Instance.new("Script", p)
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
07 Dec 2013 02:22 PM
But editing it live from the server is a bit complex and it probably requires using loadstring().
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
07 Dec 2013 02:23 PM
For your second question there is a hidden property named Source, which controls the text in the script. Unfortunately, this property is protected so you can't access it. However, the function loadstring()() allows you to insert text into a script.
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
07 Dec 2013 02:25 PM
And if you are trying to change the colour of a TextLabel, or something in a Gui.
Divide each number by 255..
text.TextColor3 = Color3.new(255/255,1/255, 255/255)
Report Abuse
Silvaspark978645 is not online. Silvaspark978645
Joined: 16 Nov 2013
Total Posts: 13
07 Dec 2013 02:46 PM
how would the load string work?
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
07 Dec 2013 02:59 PM
Kohls admin method:

Put a string value inside a script.

Change the value of that value to your script.

put this inside the script you might want to clone and edit the script:
repeat wait() until script:findFirstChild("Code")
loadstring(script.Code.Value)()

Obviously Code being the value.
Edit the script as it fits you.
Report Abuse
Silvaspark978645 is not online. Silvaspark978645
Joined: 16 Nov 2013
Total Posts: 13
07 Dec 2013 04:44 PM
ok i did that, now how can i edit the script to help me insert it into my new instances? is it a line of code? i want to make it a function in my main script.
Report Abuse
Silvaspark978645 is not online. Silvaspark978645
Joined: 16 Nov 2013
Total Posts: 13
07 Dec 2013 04:57 PM
rise again Post!
*waves dark wand*
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
07 Dec 2013 05:00 PM
well you could just create a script and put it inside lighting then

game.Lighting.Script:Clone().Parent = workspace.Estro
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
07 Dec 2013 05:04 PM
i ROFLed at Vector3.
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
07 Dec 2013 05:05 PM
script.Code.Value = "Paste in your code here!"
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
07 Dec 2013 05:39 PM
First Question :
LOCALINSTANCEOFBRICK.BrickColor.Color = Color3.new(255, 255, 255)--the brick's brickcolor's property of Color is color3, but the brick's BrickColor is actually BrickColor.new("color")

Another way of making the brick white is by doing

LOCALINSTANCEOFBRICK.BrickColor = BrickColor.new("Industrial white")

Second Question:
local brick = Instance.new("Part", workspace)
brick.Name = "Estro"
local script = script.ScriptToCopy:clone() -- Currently, you can't edit a script's source via properties
script.Parent = brick
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