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
 

Meet more than 1 if parameter , then run script?

Previous Thread :: Next Thread 
crash9000000 is not online. crash9000000
Joined: 12 Sep 2009
Total Posts: 194
06 Apr 2015 01:09 AM
I have a script that does some stuff on key down. I also have a value called "Energy" located at PlayerGui.BU7Stats.CharStats.Energy. The objective is to have the script activate when if the key is pressed AND the energy value is greater than the required amount of "Energy". How can I do this?

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local char = player.Character

function onkey(key)
if key == "z"
then
char.BTorso.ForceController.BodyThrust.location = Vector3.new(0,0,-100)
wait()
char.BTorso.ForceController.BodyThrust.force = Vector3.new(0,0,98000)
wait()
char.BLArm.ShieldPart.Transparency = 0.2
wait()
char.BTorso.DragonSoul.Transparency = 0.75
wait()
char.BTorso.TorsoMain.Fire.Enabled = true
wait(1.5)
char.BTorso.ForceController.BodyThrust.location = Vector3.new(0,0,0)
wait()
char.BTorso.ForceController.BodyThrust.force = Vector3.new(0,0,0)
wait()
char.BLArm.ShieldPart.Transparency = 1
wait()
char.BTorso.DragonSoul.Transparency = 1
wait()
char.BTorso.TorsoMain.Fire.Enabled = false

print("Test Succesfull")
end
end

mouse.KeyDown:connect(onkey)
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
06 Apr 2015 03:07 AM
if key == 'z' and Energy > req then
Report Abuse
crash9000000 is not online. crash9000000
Joined: 12 Sep 2009
Total Posts: 194
08 Apr 2015 12:51 PM
Output now says CNOStats is not a member of PlayerGui.
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