Forum

> > CS2D > Scripts > BUG
Forums overviewCS2D overview Scripts overviewLog in to reply

English BUG

6 replies
To the start Previous 1 Next To the start

old BUG

xSkyLordx
User Off Offline

Quote
Hi everyone, i made a new script but its not work, i can equip Cloth but i cant drop.(i dont used Arrays, im tried lua in OFFLINE/LAN). mmm i need yours help
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
31
32
33
34
35
36
37
38
39
40
cls={}
m=0
time=0
function spawncl(x,y,tx,ty)
local c={x=x,y=y,tx=tx,ty=ty,img=image("gfx/yceket.png",x,y,3)}
table.insert(cls,c)
imagepos(c.img,x,y,0)
end

addhook("say","scl")
function scl(id,txt)
if txt=="cc" then
spawncl(player(id,"x"),player(id,"y"),player(id,"tilex"),player(id,"tiley"))
end
end

addhook("second","bugfix")
function bugfix()
time=time-1
end


addhook("use","seqq")
function seqq(id)
for a=1,#cls do
x=player(id,"tilex")
y=player(id,"tiley")
if x==cls[a].tx and y==cls[a].ty and m==0 then
freeimage(cls[a].img)
cls[a].img=image("gfx/ceket.png",1,1,200+id)
m=1
time=2
if m==1 and time<2 then
freeimage(cls[a].img)
spawncl(player(id,"x"),player(id,"y"),player(id,"tilex"),player(id,"tiley"))
m=0
end
end
end
end

Admin/mod comment

please think about a better title...

old Re: BUG

tom282f3
User Off Offline

Quote
What is it mean that YOU DO USE ARRAY but you said YOU DIDN'T?

1
2
(Line 5, function "spawncl")
local c={x=x,y=y,tx=tx,ty=ty,img=image("gfx/yceket.png",x,y,3)}

old Re: BUG

EngiN33R
Moderator Off Offline

Quote
Despite there are differences between arrays and tables, the thing is - there are no arrays in Lua, only tables. Get your facts straight.

This isn't the full code.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview