Forum

> > CS2D > Scripts > How to make free image lua?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to make free image lua?

4 replies
To the start Previous 1 Next To the start

old Re: How to make free image lua?

Ashelin
BANNED Off Offline

Quote
@user Apache uwu: I'm guessing he wants to make an image script with who you can make images appear. Exactly as an Env_Sprite would do. Except, you'd have a command for it. /setimage <x> <y> <image> Or something like that.
I don't really see why he would need a script, if he can just use the map editor.

@user brofistmsia: You mean the infamous kbg2d

old Re: How to make free image lua?

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
img = {}

addhook("say","makeimg")
function makeimg(id,t)
	if string.sub(1,4) == "!img" then
		img[id]=image("gfx/yourfolder/"..string.sub(6)..".png",0,0,0)
	elseif string.sub(1,4) == "!pos" then
		if img[id]~= nil then
			imagepos(img[id],player(id,"x"),player(id,"y),0)
		else
			msg2(id,"You're trying to move a non existing image")
		end
	elseif string.sub(1,5) == "!free" then
		if img[id]~= nil then
			freeimage(img[id])
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview