Forum

> > CS2D > Scripts > Image Drop And Take
Forums overviewCS2D overview Scripts overviewLog in to reply

English Image Drop And Take

13 replies
To the start Previous 1 Next To the start

old Image Drop And Take

xSkyLordx
User Off Offline

Quote
Hello everybody, i need one Lua script Image Drop and take
im asking everybody for 3 week but no body help me

i want make Tshirt

Thanks ..

old Re: Image Drop And Take

Yates
Reviewer Off Offline

Quote
He wants a script like Tibia, where you have a scripted item which can be dropped and picked up. With that he will make a T-shirt. Nothing hard about that there omg.

old Re: Image Drop And Take

xSkyLordx
User Off Offline

Quote
@user Yates: He wants a script like Tibia, where you have a scripted item which can be dropped and picked up. With that he will make a T-shirt. Nothing hard about that there omg.

Yes i want this one

old Re: Image Drop And Take

omg
User Off Offline

Quote
ohh...it doesnt make sense when u dont know english and word it funny
u wanna make a tshirt with it? i dont understand...nvm

old Re: Image Drop And Take

SkullzOrig
User Off Offline

Quote
He just wants to make new equipment with different powers. In other words, he just wants to copy from tibia and add to whatever it is he is making. Thats easy, pretty sure he could do himself.
DON'T BE LAZY LEARN TO DO YOURSELF!
Since the script is already done.

old Re: Image Drop And Take

TimeQuesT
User Off Offline

Quote
One of my unreleased scripts...

More >

old Re: Image Drop And Take

J4x
User Off Offline

Quote
Create a new text file, paste the code there and change the file extension to .lua. Then copy the name of the file and add the file to cs2d/sys/lua then add this to server.lua: dofile("sys/lua/nameofyoufile.lua")

old Re: Image Drop And Take

EP
User Off Offline

Quote
I made an example for you, I have explained everything here, hope you will understand it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
items = {} -- maintable for items on the floor
function additem(x,y,img) -- just an example, adding an item with pos X,Y
	local newitem = {} -- a simple table to the new item
	newitem.x = x -- putting X pos
	newitem.y = y -- putting Y pos  
	newitem.img = image(img,0,0,1) -- putting an image to the item
	table.insert(items,newitem) --inserting the newitem to the items maintable
end

addhook("use","d")
function d(id,e,d,x,y)
	for k,v in ipairs(items) do -- reading the items maintable
		if v.x ~= nil then
			if player(id,"tilex") == v.x/32 and player(id,"tiley") == v.y/32 then --checking if some item have the same position of the player
				msg2(id,"You have picked up an item") -- You have picked up an item!
				freeimage(v.img) -- finally, remove the item from the map
				v.x,v.y = nil,nil -- later.... remove the table of that item
			end
		end
	end
end

addhook("serveraction","c")
function c(id,a)
	if a == 2 then -- if F3...
		local x,y = player(id,"tilex")*32,player(id,"tiley")*32 -- the pixels of the player, it is more efficient
		additem(x,y,"gfx/flare1.bmp") -- adding an item at the player's position
		imagepos(items[#items].img,x+16,y+16,0) -- putting the right position of the image, with a x,y offset of 16 to centre it ;D
	end -- endif
end -- endfunction
Press F3 to drop an item, and press the use button "E" to pick up an item.
Edit it as you want, giving credits aswell.
edited 2×, last 10.06.12 11:49:25 pm

old Re: Image Drop And Take

Navy Seal
User Off Offline

Quote
user Sparty has written
I hate it why someone makes a thread JUST to ask someone to make a script

That is still better than "what is your favprite" topics.

old Re: Image Drop And Take

xSkyLordx
User Off Offline

Quote
user EP has written
I made an example for you, I have explained everything here, hope you will understand it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
items = {} -- maintable for items on the floor
function additem(x,y,img) -- just an example, adding an item with pos X,Y
	local newitem = {} -- a simple table to the new item
	newitem.x = x -- putting X pos
	newitem.y = y -- putting Y pos  
	newitem.img = image(img,0,0,1) -- putting an image to the item
	table.insert(items,newitem) --inserting the newitem to the items maintable
end

addhook("use","d")
function d(id,e,d,x,y)
	for k,v in ipairs(items) do -- reading the items maintable
		if v.x ~= nil then
			if player(id,"tilex") == v.x/32 and player(id,"tiley") == v.y/32 then --checking if some item have the same position of the player
				msg2(id,"You have picked up an item") -- You have picked up an item!
				freeimage(v.img) -- finally, remove the item from the map
				v.x,v.y = nil,nil -- later.... remove the table of that item
			end
		end
	end
end

addhook("serveraction","c")
function c(id,a)
	if a == 2 then -- if F3...
		local x,y = player(id,"tilex")*32,player(id,"tiley")*32 -- the pixels of the player, it is more efficient
		additem(x,y,"gfx/flare1.bmp") -- adding an item at the player's position
		imagepos(items[#items].img,x+16,y+16,0) -- putting the right position of the image, with a x,y offset of 16 to centre it ;D
	end -- endif
end -- endfunction
Press F3 to drop an item, and press the use button "E" to pick up an item.
Edit it as you want, giving credits aswell.


Thank you, ı edited this. Now hat can drop thanks
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview