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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
xstart=0
ystart=0
xend=5
yend=5
pos={}
healready={}
timetoheal={}
addhook("join","_join")
function _join(id)
pos[id]=false
healready[id]=true
timetoheal[id]=0
end
addhook("say","_say")
function _say(id,message)
if message=="!UseGreen" then
if pos[id] and healready[id] then
if player(id,"health")~=player(id,"maxhealth") then
timetoheal[id]=0
parse("sethealth "..id.." "..player(id,"maxhealth"))
healready[id]=false
msg2(id,"©000255000Heal used")
else
msg2(id,"©000255000You have fulllive")
end
else
if not pos[id] then
if healready[id] then
msg2(id,"©000255000You are not in the healarea")
else
msg2(id,"©000255000You are not in the healarea and wait "..(25-timetoheal[id]).."Minutes until heal is ready")
end
else
msg2(id,"©000255000Heal is not ready. Please wait "..(25-timetoheal[id]).."Minutes until heal is ready")
end
end
elseif string.sub(message,1,1)=="!" then
msg2(id,'©000255000Do you want to heal? Then write "!UseGreen"')
end
end
addhook("movetile","_movetile")
function _movetile(id,x,y)
if x>=xstart and x<=xend and y>=ystart and y<=yend then
pos[id]=true
if healready[id] then
playerimg=image("gfx/shadow.bmp<b>",0,0,100+id,id)
imageblend(playerimg,1)
imagecolor(playerimg,0,255,0)
imagescale(playerimg,1.5,1.5)
end
function _freeimage(deleteimage)
freeimage(deleteimage)
end
timer(100,"_freeimage",playerimg)
else
pos[id]=false
end
end
addhook("minute","_minute")
function _minute()
for p=1, 32 do
timetoheal[p]=timetoheal[p]+1
if timetoheal[p]==25 then
healready[p]=true
msg2(p,"©000255000Heal is ready")
end
end
end