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: How do you make lives?

Previous Thread :: Next Thread 
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
25 Nov 2015 11:23 AM
How do you make lives?
If you want to see my scripts, check them here:
ServerScriptSeverice:
local replicatedstorage = game.ReplicatedStorage
local status = replicatedstorage.Value
local LivesG = game.StarterGui.ScreenGui.Lives
for i = 29,1,-1 do
if game.Workspace:FindFirstChild().Humanoid.Health < 0 then
status.Value = "Lives: "..i
end
end

LocalScript (into the status):
local replicatedstorage = game:GetService("ReplicatedStorage")
local status = replicatedstorage:WaitForChild("StatusValue")

script.Parent.Text = status.Value
status.Changed:connect(function()
script.Parent.Text = status.Value

end)

I put a BoolValue Into the Repilated Storage, Where do i go next?
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
25 Nov 2015 11:43 AM
yankee doodle bumped this
Report Abuse
PerilousDanger is not online. PerilousDanger
Joined: 21 Aug 2012
Total Posts: 3773
25 Nov 2015 11:44 AM
What are you trying to do exactly?
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
25 Nov 2015 11:45 AM
Making lives for a project, kinda like a game im on alot
u figer the game out
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
25 Nov 2015 12:01 PM
dododo bumper car bumps
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
25 Nov 2015 12:35 PM
bumpsies
(im greedy right?)
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
25 Nov 2015 12:47 PM
is this the end of my post
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
25 Nov 2015 02:53 PM
rip
Report Abuse
TheBuilderGames is not online. TheBuilderGames
Joined: 28 Mar 2013
Total Posts: 211
25 Nov 2015 06:02 PM
get a cat, and take it's lives :)



"It's your fault."
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
25 Nov 2015 06:55 PM
but really, how do u
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
25 Nov 2015 07:44 PM
MASTER BUMP!
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
27 Nov 2015 12:22 PM
i guess this is it
Report Abuse
SaluteMeScrub is not online. SaluteMeScrub
Joined: 28 Dec 2013
Total Posts: 380
27 Nov 2015 12:25 PM
Well the core would be this:

lives = 3
dead = false

if dead == true then
lives = lives - 1
end

if lives == 0 then
print("Game over!")
end
Report Abuse
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
27 Nov 2015 01:01 PM
Regular script in the Workspace



game.Players.PlayerAdded:connect(function(p)
local lives = 5
p.CharacterAdded:connect(function(c)
c.Humanoid.Died:connect(function()
lives = lives - 1
print("You have "..lives.." left!")
if lives == 0 then
print("You lose!")
end
end)
end)
end)
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
27 Nov 2015 01:32 PM
oh sorry, forgot to say:
Im using GUIs, and level backs (die 30 times, you go back to a level...)
Report Abuse
DeveloperBlue is not online. DeveloperBlue
Joined: 15 Apr 2009
Total Posts: 1344
27 Nov 2015 01:45 PM
Use the Humanoid.Died() event to detect a death,
Simply have a counter that tracks each death. Add 1 every death. At 30 deaths, reset the counter to 0, subtract 1 from the level, and respawn the player at the right level.
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
28 Nov 2015 06:41 PM
Do you have a line of code that might fit that?
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
29 Nov 2015 11:14 AM
um
Report Abuse
DeveloperBlue is not online. DeveloperBlue
Joined: 15 Apr 2009
Total Posts: 1344
29 Nov 2015 11:20 AM
Here's a rough example

local MaxLives = 30

function MoveToLevel(Level, Player)
-- Code that puts you on the right level, ex:
repeat wait() until Player.Character
Player.Character:MoveTo(Workspace:FindFirstChild(Level.."Spawn").Position)
end

game.Players.PlayerAdded:connect(function(Player)
local Level, Lives = 1, MaxLives
Player.CharacterAdded:connect(function(Character)
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:connect(function()
Lives = Lives - 1
if Lives <= 0 then
Level = Level - 1
end
end)
MoveToLevel(Level, Player)
end)
end)
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
29 Nov 2015 12:04 PM
Well, how do you do it with Screnn GUI's?
If you haven't seen in a few posts back...
Report Abuse
minedad22 is not online. minedad22
Joined: 05 Oct 2012
Total Posts: 1127
30 Nov 2015 06:57 PM
rip this post, and " "
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