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 » Game Design
Home Search
 

Re: A question about a script that is likely very basic

Previous Thread :: Next Thread 
jesusfreaksays is not online. jesusfreaksays
Joined: 26 Feb 2015
Total Posts: 26
20 May 2017 03:07 PM
well this may be considered having someone else do my homework, but I'm new to scripting. new as in I started on Thursday. I've already learned a lot but I got stuck on this: how could you make a script that does the following:

-wait 30 seconds on starting
-turn the part red
-wait 5 seconds
-make the part disappear
-wait 5 seconds
-make it reappear in its original Brick Color (lets say green)

and loop that whole thing (after it reappears, wait 30 seconds before turning red again etc.)

I know some of it, like BrickColor and wait, but I really can't put it all together. I have a feeling this could be simple for the experienced scripter, but alas I'm just the opposite

your help is very much appriciated
Report Abuse
jordan0810 is not online. jordan0810
Joined: 03 Jun 2012
Total Posts: 846
20 May 2017 03:14 PM
Since you explained your problem and asked nicely unlike the majority of people on here..

--Create the part and parent it to workspace
local part = Instance.new('Part')
part.Parent = workspace

while true do --Endless loop
wait(30)
local previousColor = part.BrickColor --Take note of the previous brickcolor
part.BrickColor = BrickColor.Red() --Change brick color to red
wait(5)
part.Transparency = 1 --Make brick invisible
wait(5)
part.BrickColor = previousColor --Set brick color to original color
part.Transparency = 0 --Make brick visible
end
Report Abuse
jesusfreaksays is not online. jesusfreaksays
Joined: 26 Feb 2015
Total Posts: 26
20 May 2017 03:28 PM
Thank you! My one question on that would be to ask if using part.transparency will make it physically disappear or only make it invisible. I was attempting to make a brick disappear to drop certain objects, and turning the brick transparent probably won't do that. I'm so new to this that I can't be sure, but changing the transparency shouldn't actually destroy the part, right?
Report Abuse
XltiMon is not online. XltiMon
Joined: 21 Mar 2017
Total Posts: 116
20 May 2017 03:32 PM
If you destroy the part nothing will be able to come out of the parts so like you're trying to make a tycoon and you have parts coming out of it if you destroy the part the part it ceases to exist
Report Abuse
jesusfreaksays is not online. jesusfreaksays
Joined: 26 Feb 2015
Total Posts: 26
20 May 2017 03:35 PM
True. Is there any way to change the density, then, to allow objects to pass through?
Report Abuse
NovaPrimus is not online. NovaPrimus
Joined: 21 Apr 2013
Total Posts: 455
20 May 2017 03:38 PM
Making "density" is extremely complicated. CanCollide is how you would make objects and other parts able to collide or not.
Report Abuse
jesusfreaksays is not online. jesusfreaksays
Joined: 26 Feb 2015
Total Posts: 26
20 May 2017 03:39 PM
Gosh it probably has something to do with CanCollide, but I'm noob enough I can't put this all together lol
Report Abuse
jesusfreaksays is not online. jesusfreaksays
Joined: 26 Feb 2015
Total Posts: 26
20 May 2017 03:41 PM
That's sort of what I was typing as you posted that. I'll figure out CanCollide I think
Report Abuse
NovaPrimus is not online. NovaPrimus
Joined: 21 Apr 2013
Total Posts: 455
20 May 2017 03:41 PM
Haha, it's fine. I read previous posts. Could you explain what you're trying to do with the part other than having it alter its color?
Report Abuse
NovaPrimus is not online. NovaPrimus
Joined: 21 Apr 2013
Total Posts: 455
20 May 2017 03:42 PM
Is it like a tycoon type dropper, but not exactly tycoon related?
Report Abuse
jesusfreaksays is not online. jesusfreaksays
Joined: 26 Feb 2015
Total Posts: 26
20 May 2017 03:49 PM
I basically just want the part to turn invisible (transparency) and let objects pass through (CanCollide) so I think if I could add the on/off switch of CanCollide into the script, it would work. Does that make some sense?
Report Abuse
jordan0810 is not online. jordan0810
Joined: 03 Jun 2012
Total Posts: 846
20 May 2017 03:54 PM
You have a few options, such as cancollide, changing the cframe or changing the parent, below includes all 3 examples but only 1 is required.

--Create the part and parent it to workspace
local part = Instance.new('Part')
part.Parent = workspace

while true do --Endless loop
wait(30)
local previousColor = part.BrickColor --Take note of the previous brickcolor
part.BrickColor = BrickColor.Red() --Change brick color to red
wait(5)
part.Transparency = 1 --Make brick invisible
part.CanCollide = false --Parts wont collide
part.CFrame = part.CFrame - Vector3.new(0, 100, 0) --We moved the part under map
part.Parent = game.ServerStorage --Take it away from workspace
wait(5)
part.BrickColor = previousColor --Set brick color to original color
part.Transparency = 0 --Make brick visible
part.CanCollide = true --Parts will collide
part.CFrame = part.CFrame - Vector3.new(0, 100, 0) --Move part back to position
part.Parent = workspace --Put it back to workspace
end
Report Abuse
jesusfreaksays is not online. jesusfreaksays
Joined: 26 Feb 2015
Total Posts: 26
20 May 2017 04:19 PM
Thank you again, but I don't believe I did it right. the exact script I have in my game is below(my part is simply called "part")

---------------

local part = Instance.new('Part')
part.Parent = workspace

while true do
wait(30)
local Bronze = part.BrickColor
part.BrickColor = BrickColor.Red()
wait(5)
part.Transparency = 1
part.CanCollide = false
wait(5)
part.BrickColor = Bronze
part.Transparency = 0
part.CanCollide = true
end

-------------------

did I do something wrong?
Report Abuse
jordan0810 is not online. jordan0810
Joined: 03 Jun 2012
Total Posts: 846
20 May 2017 04:21 PM
Delete the top two lines;

local part = Instance.new('Part')
part.Parent = workspace

Then place this line at the top

local part = workspace.part
Report Abuse
jesusfreaksays is not online. jesusfreaksays
Joined: 26 Feb 2015
Total Posts: 26
20 May 2017 04:28 PM
well, I'm an idiot but it comes with trying to take a crash course on scripting I guess. I already tried it and im happy to say it works perfectly! Thanks so much for your help, it means a lot
Report Abuse
jordan0810 is not online. jordan0810
Joined: 03 Jun 2012
Total Posts: 846
20 May 2017 04:30 PM
No problem
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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