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
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
| |
|
|
| 25 Nov 2015 11:44 AM |
| What are you trying to do exactly? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
| |
|
minedad22
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
|
| 25 Nov 2015 12:35 PM |
bumpsies (im greedy right?) |
|
|
| Report Abuse |
|
|
minedad22
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
|
| 25 Nov 2015 12:47 PM |
| is this the end of my post |
|
|
| Report Abuse |
|
|
minedad22
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
| |
|
|
| 25 Nov 2015 06:02 PM |
get a cat, and take it's lives :)
"It's your fault." |
|
|
| Report Abuse |
|
|
minedad22
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
| |
|
minedad22
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
| |
|
minedad22
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
| |
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
| |
|
|
| 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
|
  |
| 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
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 1127 |
|
| |
|