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 » Scripters
Home Search
 

Re: Ok... So I am trying to make my ambulances' lights flash...

Previous Thread :: Next Thread 
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 06:35 PM
Ok... I already have the siren ready! But when I click the lights button nothing happens! Im making it so the material will change to Neon because neon is bright and looks like a light! Here's My progress!


P.S. l1 means L one but i have it l1 :P


amb = game.Workspace.ambo

function onClicked()

game.Workspace.ambo.l1.Material = Neon
wait(1)
game.Workspace.ambo.l1.Material = Plastic
game.Workspace.ambo.l2.Material = Neon
wait(1)
game.Workspace.ambo.l2.Material = Plastic
game.Workspace.ambo.l3.Material = Neon
wait(1)
game.Workspace.ambo.l3.Material = Plastic
game.Workspace.ambo.l4.Material = Neon
wait(1)
game.Workspace.ambo.l4.Material = Plastic
game.Workspace.ambo.l5.Material = Neon
wait(1)
game.Workspace.ambo.l5.Material = Plastic
game.Workspace.ambo.l6.Material = Neon
wait(1)
game.Workspace.ambo.l6.Material = Plastic
game.Workspace.ambo.l7.Material = Neon
wait(1)
game.Workspace.ambo.l7.Material = Plastic
game.Workspace.ambo.l8.Material = Neon
wait(1)
game.Workspace.ambo.l8.Material = Plastic
game.Workspace.ambo.l9.Material = Neon
wait(1)
game.Workspace.ambo.l9.Material = Plastic
game.Workspace.ambo.l10.Material = Neon
wait(1)
game.Workspace.ambo.l10.Material = Plastic
game.Workspace.ambo.l11.Material = Neon
wait(1)
game.Workspace.ambo.l11.Material = Plastic

end

script.Parent.MouseButton1Click:connect(onClicked)
Report Abuse
coolestblue is not online. coolestblue
Joined: 07 Dec 2010
Total Posts: 13444
20 Jul 2016 06:42 PM
You have to put in a click detector
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 06:44 PM
I'm using a TextButton! I have the same function (function onClicked()) on the other script(Siren) and it works
Report Abuse
ImDgilly is not online. ImDgilly
Joined: 23 Oct 2010
Total Posts: 76
20 Jul 2016 06:45 PM
Yeah, MouseButton1Click is not a valid event of a part.
You need a mouseclickdetector.
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 06:47 PM
The button where you click to turn the lights on is in starterGui... I'm not clicking a physical part..
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
20 Jul 2016 06:47 PM
function onClicked()

for i = 1,10 1 do

game.Workspace.ambop["l"..i].Material = Plastic
game.Workspace.ambop["l"..i+1].Material = Plastic
wait(1)
end
end
script.Parent.MouseButton1Click:connect(onClicked)


Add 13,000 posts
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 06:48 PM
each part l1,l2,l3 ect is a light. I want it so when you click it they flash
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 06:50 PM
function onClicked()

for i = 1,10 1 do <--- Error at the last one before do...

game.Workspace.ambop["l"..i].Material = Plastic <--- and whats ambop?
game.Workspace.ambop["l"..i+1].Material = Plastic
wait(1)
end
end
script.Parent.MouseButton1Click:connect(onClicked)
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
20 Jul 2016 06:51 PM
forgot a comma after the 10

fml


Add 13,000 posts
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
20 Jul 2016 06:53 PM
Dgilly, so we meet again. That dumb kid from v3rm hating on my stuff. Just remember, I got dat underground army and I holdin down.


#code print("While I may look like a cataclysmic god of the eggs from the future, I am not.")
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
20 Jul 2016 06:54 PM
should be 1, 10, 1 do

he misread your original post and wrote ambop instead of ambo, you could easily deduce that
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
20 Jul 2016 06:55 PM
well, at least it will take 2 sec to edit instead of taking 20000000 lines of editing


Add 13,000 posts
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 06:56 PM
I figured the ambo part out. but i don't see anything changing to Neon
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
20 Jul 2016 06:58 PM
function onClicked()

for i = 1,10,1 do

game.Workspace.ambo["l"..i].Material = Enum.Material.Neon
game.Workspace.ambo["l"..i+1].Material = Enum.Material.Plastic
wait(1)
end
end
script.Parent.MouseButton1Click:connect(onClicked)


Add 13,000 posts
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 06:59 PM
Ok. so i the lights are starting but when they all light up they stay lit up. I need them flashing! We're getting somewhere now :P
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
20 Jul 2016 07:00 PM
that's not exactly the same as his script.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
20 Jul 2016 07:01 PM
well this got a bit complicated

local alternate = true
unction onClicked()

for i = 1,10,1 do

if alternate then
game.Workspace.ambo["l"..i].Material = Enum.Material.Neon
game.Workspace.ambo["l"..i+1].Material = Enum.Material.Plastic
alternate = false
else
game.Workspace.ambo["l"..i].Material = Enum.Material.Plastic
game.Workspace.ambo["l"..i+1].Material = Enum.Material.Neon
alternate = true
wait(1)
end
end
end
script.Parent.MouseButton1Click:connect(onClicked)


Add 13,000 posts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
20 Jul 2016 07:03 PM
"unction"

how does this even happen lol


Add 13,000 posts
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
20 Jul 2016 07:03 PM
At the start it makes l1 neon then waits 1 second and at the end it makes l11 plastic i believe.
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 07:05 PM
DANGIT!!!! NOW ONLY SOME OF THEM LIGHT UP!!! R.I.P AMBO!
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
20 Jul 2016 07:08 PM
rage quit


Add 13,000 posts
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 07:09 PM
Lol Bye Bye! Guess some ambos dont gave lights...
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 07:14 PM
Somehow we gotta get dem lights to shut off when there lit! SMH
Report Abuse
NateDawgGamingRoHD is not online. NateDawgGamingRoHD
Joined: 06 Jan 2012
Total Posts: 159
20 Jul 2016 07:17 PM
what about math.ramdom? so each one will come on randomly until you click the off button?
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
20 Jul 2016 07:20 PM
I really want to help you, but first you have to help me understand what exactly the end behaviour is too look like.

Will all the lights alternate at the same time? Will it be half and half? Is only on light being turned on and off at a time like in your original script? And for how long? How many cycles do you want it to go through?

Thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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