Illusion System

Post Reply
Skriptz
Posts: 45
Joined: Sun Dec 27, 2009 10:48 pm

Illusion System

Post by Skriptz »

Okay I'm attempting to make a illusion system which isn't working out.

In alias I have this
Code: [show] | [select all] lua
varIllusion = ginseng
echo("\nUsing Relapsing illusions.")
In script I have this
Code: [show] | [select all] lua
function illusion()
	if varIllusion == goldenseal then
	expandAlias("ill You shuffle your feet noisily, suddenly bored. and a test")
	elseif varIllusion == "ginseng" then
	 illGinseng() else
	end
end
I also have this
Code: [show] | [select all] lua
function illGinseng()

	if varIllusion == ginseng then
	expandAlias("ill ill Javar sinks his fangs into your body and you wince in pain.\nYou feel light headed and dizzy.")

end --ends If statement
end --ends function
So I use the alias ig short for Illusion Ginseng and I get the using Relapsing Illusions echo however every time I attack someone it sends "ill You shuffle your feet noisily, suddenly bored. and a test"

Could someone help me work out why it won't change the variable or run the Illusion function?

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Illusion System

Post by tsuujin »

you're trying to assign the variable varIllusion to the variable ginseng, which is probably not what you wanted to do.

change it to varIllusion = "ginseng" (there are multiple occurances you'll have to change) and that might fix it.

Skriptz
Posts: 45
Joined: Sun Dec 27, 2009 10:48 pm

Re: Illusion System

Post by Skriptz »

Thanks that works. I didn't realize that it needs to be a string with quotes otherwise it will see it as a variable and not a string.

Thanks again.

Post Reply