English Tibia script thread (Post tibia requests here)

347 replies
Goto Page
To the start Previous 1 2 ... 5 6 7 ... 17 18 Next To the start
05.02.12 01:03:38 am
Up
Kantos
BANNED
Offline Off
im just asked it look at down :DD
05.02.12 02:10:15 am
Up
kalis
User
Offline Off
can you show me code ?
i dont really understand
05.02.12 02:20:56 am
Up
KenVo
User
Offline Off
A Mod or an admin really should ban kakalas228 for making 2 accounts and pushed this thread...
05.02.12 02:21:52 am
Up
skillerLTU
User
Offline Off
user KenVo has written:
A Mod or an admin really should ban kakalas228 for making 2 accounts and pushed this thread...

kakalas is not me i just made almost same question sorry

EDIT: so can you help?
I scored 100% on the Minecraft Trivia Quiz. How much do you know about Minecraft?
05.02.12 02:25:01 am
Up
KenVo
User
Offline Off
I help when I want to, and stop fking annoy me by private message and posting it over and over again because it will decrease the chance of me helping.
05.02.12 02:28:40 am
Up
skillerLTU
User
Offline Off
user KenVo has written:
I help when I want to, and stop fking annoy me by private message and posting it over and over again because it will decrease the chance of me helping.


ok sorry... dont be angry on me its 3:28am...
I scored 100% on the Minecraft Trivia Quiz. How much do you know about Minecraft?
05.02.12 02:32:01 am
Up
KenVo
User
Offline Off
What do that have to do with spamming and pushing thread?
05.02.12 02:56:52 am
Up
kalis
User
Offline Off
kenvo
can you show me the script
fixed ?
05.02.12 02:57:54 am
Up
KenVo
User
Offline Off
what script ?
05.02.12 03:38:54 am
Up
4Vendetta
User
Offline Off
IMG:http://orig12.deviantart.net/d660/f/2015/294/4/a/loki_free_icon_smite_by_cuti_chan-d9dwjst.gif
No one can play Masturball... IMG:http://orig08.deviantart.net/2bdc/f/2015/360/1/f/khepri_free_icon_smite_by_cuti_chan-d9llycr.gif
05.02.12 03:53:35 am
Up
KenVo
User
Offline Off
I'm sure nobody going to help you with that, so start learn to code.
05.02.12 07:51:23 am
Up
kalis
User
Offline Off
fix :
i cant fight the monster behind wall !
05.02.12 07:07:13 pm
Up
KenVo
User
Offline Off
I think you should use distance formula to measure the distance between the player and monster. Then if there is an object between it then no damage will be dealt to the monster.
IMG:http://upload.wikimedia.org/wikipedia/en/math/f/0/a/f0a4a3d633ef96d31f068e387cd91fc2.png
05.02.12 09:08:38 pm
Up
ExecL
User
Offline Off
when i host a tibia server with cs2d dedicated and i join theres no way for me to ban hackers and kick laggers so
i tryed adding them my self but it had a lot of errors so could you add ban and kick to this?

Code:
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
addhook('say','adminCommands',-1)
adminList = {} 
function isAdmin(id)
     for _, usgn in ipairs(adminList) do
          if player(id,'usgn') == usgn then
               return true
          end
     end
     return false
end

function adminCommands(id,words)
     if isAdmin(id) and words:sub(1,1) =='!' then
          local command = words:lower():sub(2,2)
          if words:sub(3,3) ~= ' ' and #words ~= 2 then return end
          print(player(id,'name')..' used a command:'..words)
          if command =='a' then
               local distance = tonumber(words:sub(4))
               if distance then
                    local rot = math.rad(player(id,'rot')-180)
                    local x, y = -math.sin(rot)*distance*32, math.cos(rot)*distance*32
                    parse('setpos '..id..' '..player(id,'x')+x..' '..player(id,'y')+y)
               else
                    msg2(id,'Teleport forward: "!a <distance>"')
               end
               return 1
          elseif command =='b' then
               msg('©255100100'..player(id,'name')..' : '..words:sub(4)..'@C')
               return 1
          elseif command =='c' then
               local target = tonumber(words:sub(4))
               if target then
                    if player(target,'exists') then
                         if target == id then
                              msg2(id,'You may not teleport to yourself!')
                         end
                         parse('setpos '..target..' '..player(id,'x')..' '..player(id,'y'))
                         return 1
                    end
               end
               msg2(id,'Teleport player to you: "!c <targetid>"')
               return 1
          elseif command =='d' then
               msg('©255100100'..words:sub(4)..'@C')
               return 1
          elseif command =='e' then
               local dmg = tonumber(words:sub(4))
               if dmg then
                    parse('explosion '..player(id,'x')..' '..player(id,'y')..' '..dmg..' '..dmg..' '..id)
                    return 1
               end
               msg2(id,'Spawn explosion: "!e <dmg>"')
               return 1
          elseif command =='i' then
               local itemid = tonumber(words:sub(4))
               if itemid then
                    additem(id,itemid)
                    return 1
               end
               msg2(id,'Spawn item: "!i <itemid>"')
               return 1
          elseif command =='h' then
               local s = words:find(' ',4)
               local target = tonumber(words:sub(4,s))
               if target then
                    if player(target,'exists') then
                         local heal = s and tonumber(words:sub(s+1,words:find(' ',s+1))) or nil
                         if heal then
                              parse('explosion '..player(target,'x')..' '..player(target,'y')..' 1 '..(-heal))
                              return 1
                         end
                    end
               end
               msg2(id,'Heal player: "!h <targetid> <amount>"')
               return 1
          elseif command =='l' then
               local script = words:sub(4)
               if script then
                    msg2(id,tostring(assert(loadstring(script))() or 'done!'))
                    return
               end
               msg2(id,'Run lua script: "!l <script>"')
               return 1
          elseif command =='m' then
               if gettile(player(id, 'tilex'), player(id, 'tiley')).SAFE then
                    msg2(id,'You may not spawn a mosnter in a safe zone.')
                    return 1
               end
               local name = words:sub(4)
               if name then
                    for i, v in pairs(CONFIG.MONSTERS) do
                         if v.name:lower() == name:lower() then
                              local m = deepcopy(v)
                              m.x, m.y = player(id, 'x'), player(id, 'y')
                              Monster:new(m)
                              msg2(id,'Monster ' .. name .. ' spawned.')
                              return 1
                         end
                    end
               end
               msg2(id,'Monster ' .. name .. ' does not exist.')
               return 1
          elseif command =='n' then
               msg2(id,'{'..player(id,'tilex')*32+16 ..', '..player(id,'tiley')*32+16 ..'}')
               return 1
          elseif command =='o' then
               msg2(id,'{'..player(id,'tilex')..', '..player(id,'tiley')..'}')
               return 1
          elseif command =='p' then
               msg2(id,'{'..player(id,'x')..', '..player(id,'y')..'}')
               return 1
          elseif command =='q' then
               local length = tonumber(words:sub(3))
               if length then
                    length = math.min(length*50,250)
                    for _, id in ipairs(player(0,'table')) do
                         parse('shake '..id..' '..length)
                    end
                    for i = 1, 6 do
                         if math.random(0,1) == 1 then
                              parse('sv_sound weapons/explode'..i..'.wav')
                         end
                    end
               else
                    msg2(id,'Earthquake: "!q <length in seconds, max 5>"')
               end
               return 1
          elseif command =='s' then
               local s = words:find(' ',4)
               local target = tonumber(words:sub(4,s))
               if target then
                    if player(target,'exists') then
                         local speed = s and tonumber(words:sub(s+1,words:find(' ',s+1))) or nil
                         if speed then
                              parse('speedmod '..target..' '..speed)
                              return 1
                         end
                    end
               end
               msg2(id,'Speed modifier: "!s <targetid> <speedmod, between -100 and 100>"')
               return 1
          elseif command =='t' then
               local target = tonumber(words:sub(3))
               if target then
                    if player(target,'exists') then
                         if target == id then
                              msg2(id,'You may not teleport to yourself!')
                         end
                         parse('setpos '..id..' '..player(target,'x')..' '..player(target,'y'))
                         return 1
                    end
               end
               msg2(id,'Teleport to player: "!t <targetid>"')
               return 1
          elseif command =='u' then
               local delay = tonumber(words:sub(3)) or 0
               shutdown(delay*1000)
               return 1
          elseif command =='v' then
               saveserver()
               msg2(id,'Saved server!')
               return 1
          end
     end
end
05.02.12 09:30:36 pm
Up
Big Bang Mafia
User
Offline Off
i need help, how i add stats (mana and other)
so i want to make the stat, then when i spawn with how much mana i spawn then special things that give mana then things that make mana gone. understand me? plz help. i'm new at tibia.
I'm back.
05.02.12 09:33:56 pm
Up
skillerLTU
User
Offline Off
user Big Bang Mafia has written:
i need help, how i add stats (mana and other)
so i want to make the stat, then when i spawn with how much mana i spawn then special things that give mana then things that make mana gone. understand me? plz help. i'm new at tibia.

easy
at config.lua
     STATS = {'Experience', 'Level', 'Money', 'mana'},
or
     STATS = {'Experience', 'Level', 'Money', 'MP'},
to add it on menu.


EDIT: but idk how to add skills or something
I scored 100% on the Minecraft Trivia Quiz. How much do you know about Minecraft?
05.02.12 09:35:52 pm
Up
Big Bang Mafia
User
Offline Off
i know how to do that, thanks for want help me.

But i need when i cast something that my mana ggets -10
or -1 you now? when i cast spell i lost mana. how i do that
I'm back.
05.02.12 09:38:01 pm
Up
ExecL
User
Offline Off
can someone help me with the ban and kick command???
06.02.12 04:14:40 am
Up
KenVo
User
Offline Off
Code:
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
elseif command =='f' then
               local target = tonumber(words:sub(4))
               if target then
                    if player(target,'exists') then
                         if target == id then
                              msg2(id,'You may not ban yourself!')
                              return
                         end
                         local usgn = player(target,'usgn')
                         local ip = player(target, "ip")
                         if ip then
                              parse('banip '..ip)
                         end
                         if usgn then
                              print(player(id, 'name').." banned "..usgn)
                              parse('banusgn '..usgn)
                         end
                         return 1
                    end
               end
               msg2(id,'Ban player: "!f <targetid>"')
               return 1     
                         elseif command =='f' then
               local target = tonumber(words:sub(4))
          elseif command =='k' then
               local target = tonumber(words:sub(4))     
               if target then
                    if player(target,'exists') then
                         if target == id then
                              msg2(id,'You may not kick yourself!')
                              return
                         end
                         print(player(id, 'name').." kicked "..player(target,'name'))
                         parse('kick '..target)
                         return 1
                    end
               end
               msg2(id,'Kick player: "!k <targetid>"')
               return 1


add that somewhere between the commands
06.02.12 09:49:22 am
Up
EngiN33R
Moderator
Offline Off
user Big Bang Mafia has written:
i know how to do that, thanks for want help me.

But i need when i cast something that my mana ggets -10
or -1 you now? when i cast spell i lost mana. how i do that


In skills that use mana, make an if-statement that would check if mana is higher than 0.
I code, therefore I exist. | Visit my blog for Lua tips and other interesting info
To the start Previous 1 2 ... 5 6 7 ... 17 18 Next To the start