I am making a lives system, and currently, I cannot get it to work. If anyone knows how to get this to work, it'd be much appreciated. Basically, if the value of "lives" is zero, it will put you on the first spawn point, and inside the GUI, the textlabel named "Text" will change according to the value.
local lives = script.Parent.Lives if lives.Value = 0 then player.Team = "Level One" end local LD = script.Parent.Parent.LivesDisplay local text = script.Parent.lives.text end
local lives = script.Parent.Lives if lives.Value == 0 then -- two = for if player.TeamColor = BrickColor.new("The color of Level One team") -- teams are set by colors, to change a player team you change its TeamColor property end -- this end is closing the if statement, you don't need one to finish the script local LD = script.Parent.Parent.LivesDisplay local text = script.Parent.lives.Value -- wasn't lives a value? so text isn't a property of it, [Value](http://wiki.roblox.com/index.php?title=Value) is
Independent of what kind of value lives
is, you will have to transform it into a string (the same kind as the TextLabel text), like this:
LD.Text = tostring(text) -- just made the text (that is lives value) a string, so it can change the TextLabel
You should check these pages on the wiki, I recommend: