![]() |
startswith ?
I have never learned how to use that command, and now I need it.. :(
Can someone just explain how to use it? Is it like NPC Code:if (startswith(#l,level){say2 You are in level-blah.graal;} :( |
Re: startswith ?
Quote:
NPC Code:if (startswith(level,#L)){say2 You are in level-blah.graal;} or u could simply do NPC Code:if (startswith(level,#L)){say2 You are in #L;} but im not sure of ur case :) |
X.X this is Projectshifter btw, my account is not working!
startswith would be used like if you want to make like a warpto script: NPC Code: a bit of extra stuff, but it says that if the string starts with what you specify. Your string: NPC Code: would make it so that if the level started with level then it would perform the action. #L needs to be capital, and it does the Level of the NPC, on an NPC Server you would want to use #F. You need to put a second end paranthese ')' to end the if statement not just the startswith. ---Shifter |
Quote:
|
To be honest, I don't know tokensize or t things either. :D
Back when everyone was learning to script, I was eating pizza. Sorry :( |
Quote:
divides str [#c] into words (tokens) which can be read with #t(index) so for example: if (playerenters||timeout) { message #v(this.x); timeout=.05; } if (playerchats) {tokenize #c; this.x=strtofloat(#t(6)); } and i said "HELLO Frank, how are you? Im 8" this.x would equal 8 also notice the strtofloat on #t(6), its cause i already knew that index of 6 would be a number... just an example to get u started... index always starts from 0 |
Let's forget it's
"startswith(start,#thing)" |
startswith(text,stringname) <-correct syntax
|
how come everyone votes bad for me? Anyways.. on the command list in the npc script window thing then theres a list of scripts and their correct syntax so check that before you post a problem! unless your like me and are too lazy to read the syntax and decide to make a big long thread =D its all good
-Wonderboy |
Quote:
|
thank you veryvery much. At least one person doesnt hate me =D
|
Quote:
lol, the syntax i posted is right anyways... i like yeah, i always like prospecting scripters, although being lazy wont get you far in scripting ;) *goes to rate* |
Quote:
|
well
Quote:
i rated you 4 |
NPC Code:"startswith (partstr,srt)" |
LOL, I laugh @ ppl when they do (syntax,stringname) I always do it:
NPC Code: it looks MUCH more organized. If you read it (read it like a sentence btw) you get if the string (playerchats) equals (start), it sounds better than if the string (start) is the value of (playerchats). It is easier to read and easier to comprehend =P ---Shifter |
All times are GMT +2. The time now is 03:26 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.