hi i have a quick question, im making a time script
but im having a bit of struggle at some storage of items into variables
the problem is i cant understand what is the difference between variable and string
i know that a variable stores data, but i tried to store words for example September, but it appears it doesnt stores letters… because when i try to let it read the info of the variable, it stays at 0.
so variables is like a storage box for numbers??
and then whats the difference between variables and strings?
and what does a string do?
help me out here
this is the script, maybe im using some kind of wrong stuff
if (playerchats) {
this.monthname = september;
message #v(this.monthname);
}
Variables are Digits/Numbers
Strings are Characters/Text
if (playerchats) {
this.monthname = september;
message #v(this.monthname);
}
‘september’ in this case would be also treated as a variable, by default, it would be 0.
So this.monthname = september; // ie: = 0
Variable: hi = 433.2;
String: setstring stringname,wtf;
‘Printing’ out a Var: message #v(hi);
‘Printing’ out a String: message #s(stringname);
Placing variables inside of a string.
setstring stringname,#v(hi);
Placing a string inside of a variable (if the string is just numbers).
hi = strtofloat(#s(stringname));
strtofloat (String to Float; Float a type of Variable)
i think i get it now
so actuely a variable and a string are basicly the same
only a variable stores numberic data
and a string only stores Characters/Text
so if i want to store numbers i need to use the #v
but if i want to store text i use the #s