Forum

> > CS2D > Scripts > wrong lua
Forums overviewCS2D overview Scripts overviewLog in to reply

English wrong lua

8 replies
To the start Previous 1 Next To the start

old wrong lua

Marcell
Super User Off Offline

Quote
whats wrong with this lua?

1
2
3
4
5
6
7
8
addhook("say","idontknow")
function idontknow(id,txt)
if (txt=="!bff") then
	freeimage(id) 
	id=image("gfx/bttf/delorean.png",1,1,200+id)
parse("speedmod "..id.." "..player(id,"speedmod")+1)
end
end

old Re: wrong lua

Yates
Reviewer Off Offline

Quote
You free the image when you don't have one. This will show an error in the console and it won't continue to do anything else.

old Re: wrong lua

Marcell
Super User Off Offline

Quote
but i have this image...
and when i type into chat: !bff
I get this EXCEPTION_ACCESS_VIOLATION

old Re: wrong lua

DC
Admin Off Offline

Quote
download cs2d again at www.cs2d.com/download (it's sufficient to replace the exe files). CS2D had a bug right after the release which crashed the game when Lua scripts with bugs were used.

old Re: wrong lua

Marcell
Super User Off Offline

Quote
user DC has written
download cs2d again at www.cs2d.com/download (it's sufficient to replace the exe files). CS2D had a bug right after the release which crashed the game when Lua scripts with bugs were used.


i redownloaded and installed into new folder but i get this error...

old Re: wrong lua

EP
User Off Offline

Quote
you're calling a bad math calcle, try this:
1
2
3
4
5
6
7
8
addhook("say","idontknow")
function idontknow(id,txt)
if (txt=="!bff") then
     freeimage(id)
     id=image("gfx/bttf/delorean.png",1,1,200+id)
parse("speedmod "..id.." "..(player(id,"speedmod")+1))
end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview