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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
NoobDesrtroyer5000 is not online. NoobDesrtroyer5000
Joined: 06 Apr 2013
Total Posts: 305
06 Jul 2013 02:41 AM
[ Content Deleted ]
Report Abuse
NoobDesrtroyer5000 is not online. NoobDesrtroyer5000
Joined: 06 Apr 2013
Total Posts: 305
06 Jul 2013 02:48 AM
[ Content Deleted ]
Report Abuse
NoobDesrtroyer5000 is not online. NoobDesrtroyer5000
Joined: 06 Apr 2013
Total Posts: 305
06 Jul 2013 02:51 AM
[ Content Deleted ]
Report Abuse
NoobDesrtroyer5000 is not online. NoobDesrtroyer5000
Joined: 06 Apr 2013
Total Posts: 305
06 Jul 2013 02:55 AM
[ Content Deleted ]
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
06 Jul 2013 03:04 AM
You can't click on a spotlight. Also, remember what I said about the Wiki? If you've tried to read it at all, you'd know that you're calling the function wrong. Anyway, you need to have the spotlight inside of a part, then place the following script inside the part alongside of the spotlight. To enable clicking detection, you need a click detector alongside them as well. It should look like this:

-Part
---SpotLight
---Script
---ClickDetector

Here's the script:
script.Parent.ClickDetector.MouseClick:connect(function()
script.Parent.SpotLight.Enabled = not script.Parent.SpotLight.Enabled
wait(.5)
script.Parent.SpotLight.Enabled = not script.Parent.SpotLight.Enabled
end)
Report Abuse
NoobDesrtroyer5000 is not online. NoobDesrtroyer5000
Joined: 06 Apr 2013
Total Posts: 305
06 Jul 2013 03:06 AM
[ Content Deleted ]
Report Abuse
NoobDesrtroyer5000 is not online. NoobDesrtroyer5000
Joined: 06 Apr 2013
Total Posts: 305
06 Jul 2013 03:16 AM
[ Content Deleted ]
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
06 Jul 2013 03:16 AM
Ah, okay. So make sure that the script is inside of a part with the click detector. The spotlight should remain in Workspace.Truck.Lights.LeftHeadlight. I'm going to go one step ahead and assume that you're trying to make the light blink when clicking on it. Here's the script:


Toggle = false

script.Parent.ClickDetector.MouseClick:connect(function()
if not Toggle then
Toggle = true
while Toggle do
Workspace.Truck.Lights.LeftHeadlight.SpotLight.Enabled = true
wait(.5)
Workspace.Truck.Lights.LeftHeadlight.SpotLight.Enabled = false
end
else
Toggle = false
Workspace.Truck.Lights.LeftHeadlight.SpotLight.Enabled = false
end)


What my script does is when you click on the button while the light isn't blinking, it will start blinking; if the light is blinking, then it will be turned off. Another important thing, case sensitivity is important in scripting. Notice how you had it as "enabled"? That won't work since it's actually "Enabled".
Report Abuse
NoobDesrtroyer5000 is not online. NoobDesrtroyer5000
Joined: 06 Apr 2013
Total Posts: 305
06 Jul 2013 03:54 AM
[ Content Deleted ]
Report Abuse
NoobDesrtroyer5000 is not online. NoobDesrtroyer5000
Joined: 06 Apr 2013
Total Posts: 305
06 Jul 2013 04:00 AM
[ Content Deleted ]
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