- Home /
Another "insert semicolon at end"
I am soo sorry I have to ask this question, I am sure you get it alot BUT when i do go the the said line and add/replace with semicolon it creates about 5 more problems. In this case the log says the problem is at 13,2
var maxShields = 100;
var curantShields = 100;
function Start () {
}
function AdjustCurantShields(var adjustShields)
{
curantShields += adjustShields;
if (curantShields>maxShields)
{
curantShields=maxShields;
}
}
function Update ()
{
if (curantShields<0){
Debug.Log("shields are down");
}
AdjustCurantShields(0);
}
I am soo sorry i had to ask this question. Thanks in advance :) I've updated the code but i am still getting problems. (6,34) expecting EOF, found 'adjustShields'. and (6,30 Unexpected token: var.
Answer by tw1st3d · Jul 29, 2013 at 09:29 PM
var maxShields : int = 100;
var curantShields : int = 100;
function Start()
{
}
function AdjustCurantShields(var adjustShields : int)
{
curantShields += adjustShields;
if (curantShields>maxShields)
curantShields = maxShields;
}
function Update()
{
if (currantShields<0)
Debug.Log("shields are down");
AdjustCurantShields(0);
}
Just so you know, curant should be current.
There is also a typo in the last adjust function call, missing r. Also the function doesn't actually do anything, as it adds 0 to the current shields.
Then in the Adjust function itself, you have an equality marker == ins$$anonymous$$d of the setting = ... in case you want to give him a working piece of code =). Oh, also in the update, there are two r in currant, when everywhere else there is one.
Thats giving me new problems such as (6,30): BCE0043: Unexpected token: var. and (6,34): BCE0044: expecting EOF, found 'adjustShields'.
Updated the code, sorry. Haven't worked with UnityScript in a while
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Help on a basic script 2 Answers
Basic toggle timer Help! 2 Answers
2d ragdoll, where to start? 1 Answer
How to make an enemy chase you and catch you when close (like slendytubbies) 0 Answers