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
 

Lives system for a platformer game

Previous Thread :: Next Thread 
attomicgreen is not online. attomicgreen
Joined: 29 Apr 2012
Total Posts: 4785
26 Mar 2016 08:01 PM
I want to know how I can make a number value change when your character gets killed, and I want to know how I can teleport the player to a different place when a value reaches a certain number (it would probably have something to do with if then statements but I am new to cross-game scripting)

ALSO, how do I get values to stay the same across different places linked to the same game?

please help, and THANKS
Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
26 Mar 2016 08:07 PM
local health = game.Players.LocalPlayer.Character.Humanoid.Health

if health == 0 then
game.Value.Value = 999
end

Report Abuse
attomicgreen is not online. attomicgreen
Joined: 29 Apr 2012
Total Posts: 4785
26 Mar 2016 08:13 PM
I got that one down, but how do I cause an event to happen with an if then statement? usually when I use if then's they only check once. How can I make it so it is always checking what the script says?

(example)
if game.Lives.Value == 0 then
Something something gameover screen yada yada yah



usually it only checks once, and if the value DOES get to 0, it does nothing because the script was ran. How can I use repeats to fix that?
Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
26 Mar 2016 08:14 PM
while wait() do
if game.Lives.Value == 0 then
Something something gameover screen yada yada yah
end
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
26 Mar 2016 08:17 PM
look into the .changed event on the wiki
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