|
Hey there, just wondering if I can get a few tips on sorting my problem out. Anyway, I got a script that makes me respawn when I die so I can respawn all the time but I wanna fix it so after 3 deaths It will load a new scene that shows me the score I got... I got the scripts for the scores so I can see it ingame but not on a new scene. I want it to load a new scene after 3 deaths and show me the score I got then. So my problems is that I want it to load a new scene after 3 deaths and then show me the score I got. is it even possible to load a scene after 3 deaths and show the score I got ( thru the GUI ) ? Well, Here is the scrip I'm using to respawn when I die: pragma strict var checkpoint : Transform; function OnSignal () { } static function ResetHealthOnAll () {
(comments are locked)
|
|
The easiest way is to use static vars - they are created when the program begins, and survive until you exit the game. You can have a Control.js script, for instance, attached to the player, where you count lives and score - something like this:
static var life: int = 3;
static var score: int = 0;
function Update(){
if (life
(comments are locked)
|
|
it's totally possible. custom google for counter, loadlevel, dontdestroyonload and scoreboard and write a script for it. Rock on. Greetz, Ky.
(comments are locked)
|

don't use '3' as a tag. also, you don't need to say the same thing with 5 different versions of wording.
The for is incomplete
also, I might be mistaken, but don't you need # in front of pragma?
does this script even work or does it give you errors all over the place?