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
 

Flashlight help

Previous Thread :: Next Thread 
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
30 May 2013 08:34 PM
Can somebody make this Work?

light = 1

function lightoff()
if light == 1 then
light = 2
wait(1)
Script.Parent.Handle.Light.Enabled = false
end
end

function lighton()
if light == 2 then
light = 1
wait(1)
Script.Parent.Handle.Light.Enabled = true
end
end

function Key(key)
if key then
key = string.lower(key)
if (key == "q") then
lighton()
if key then
key = string.lower(key)
if (key == "e") then
lightoff()
end
end
end
end
end
function Equip(mouse)
mouse.KeyDown:connect(Key)
end
script.Parent.Equipped:connect(Equip)



this is in a local script by the way.

Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
30 May 2013 08:50 PM
bump!
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
30 May 2013 08:54 PM
Read the sticky on this subforum.
Do not just post code and say 'It doesn't work!'.
You most likely won't get a reply.

~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
30 May 2013 09:08 PM
Well. I see 2 probs.
-You don't need to use string.lower() in hte places where you used them.
-Your connection line calls the function, event, which I do not see anywhere in your script, meaning none of your functions are even being called.
xP...
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