Lua Scripts/Questions/Help
6,770 replies No coment ... If you was intelligent you would have guessed it's not my script, I take this script here ... So yes, i can't fix THE script !
can some one help please

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
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
function anglerad(angle)
if (angle<=90) then
angle = (angle + 360)
end
return math.rad(math.abs( angle + 90 ))-math.pi
end
addhook("attack2","jump")
function jump(id,mode)
rot = player(id,"rot")
local angle = anglerad(rot)
local newx = player(id,"x") + math.cos(angle)* 63
local newy = player(id,"y") + math.sin(angle)* 63
local olgx = player(id,"x") + math.cos(angle)* 26
local olgy = player(id,"y") + math.sin(angle)* 26
local tx = olgx/32
local ty = olgy/32
local gx = newx/32
local gy = newy/32
if player(id,"weapontype")==78 or player(id,"weapontype")==50 then
if tile(tx,ty,"obstacle") then
if tile(gx,gy,"walkable") then
parse("setpos "..id.." "..newx.." "..newy)
player_energy[id]=player_energy[id]-3
else
msg2(id,"000255000","Nao Tem piso")
end
else
msg2(id,"000255000","nao Tem Obstaculo")
end
end
end
if (angle<=90) then
angle = (angle + 360)
end
return math.rad(math.abs( angle + 90 ))-math.pi
end
addhook("attack2","jump")
function jump(id,mode)
rot = player(id,"rot")
local angle = anglerad(rot)
local newx = player(id,"x") + math.cos(angle)* 63
local newy = player(id,"y") + math.sin(angle)* 63
local olgx = player(id,"x") + math.cos(angle)* 26
local olgy = player(id,"y") + math.sin(angle)* 26
local tx = olgx/32
local ty = olgy/32
local gx = newx/32
local gy = newy/32
if player(id,"weapontype")==78 or player(id,"weapontype")==50 then
if tile(tx,ty,"obstacle") then
if tile(gx,gy,"walkable") then
parse("setpos "..id.." "..newx.." "..newy)
player_energy[id]=player_energy[id]-3
else
msg2(id,"000255000","Nao Tem piso")
end
else
msg2(id,"000255000","nao Tem Obstaculo")
end
end
end
Sorry , I can't be Perfect !
@shuft
Try using math.floor with tx,ty,gx,gy.
Try using math.floor with tx,ty,gx,gy.
We must secure the existence of our people and a future for white children. 14/88
Dark Byte has written:
@shuft
Try using math.floor with tx,ty,gx,gy.
Try using math.floor with tx,ty,gx,gy.
well i dont know much about scripting
could you please give example ?
Sorry , I can't be Perfect !
Code:
1
2
3
4
2
3
4
local tx = math.floor(olgx/32)
local ty = math.floor(olgy/32)
local gx = math.floor(newx/32)
local gy = math.floor(newy/32)
local ty = math.floor(olgy/32)
local gx = math.floor(newx/32)
local gy = math.floor(newy/32)
maybe this ?

06.10.10 10:34:40 pm
Thank you really much Tajifun!!! It works...its a cool script and now I can make my map...

iDios has written:
No coment ... If you was intelligent you would have guessed it's not my script, I take this script here ... So yes, i can't fix THE script !
Ok, then ask to the author for a help.
because supposedly the person who uploaded it, has to help you. I saw 2 times the RP script uploaded, who's the real author then?.
@starkkz .. i dont know but seems you to be the rp script author o.O ,
can some one help with this :
Attempt to peform an Arithmetic on field '?' ( nil value )
//edit:
forget it my friend did got it already
can some one help with this :
Code:
1
rp_creds[id]=rp_creds[id]+player(id,[[money]])
Attempt to peform an Arithmetic on field '?' ( nil value )
//edit:
forget it my friend did got it already
edited 1×, last 06.10.10 11:49:44 pm
Sorry , I can't be Perfect !
what i need to add to make the stun - explosion lua script?
like when it hit someone then that person speed will be -100 in 3 second
like when it hit someone then that person speed will be -100 in 3 second
Code:
1
2
3
4
5
6
2
3
4
5
6
addhook("say","saya")
function saya(id,t)
if t=="!a" then
parse("explosion "..x.." "..y.." 10 0 "..id)
return 1
end
function saya(id,t)
if t=="!a" then
parse("explosion "..x.." "..y.." 10 0 "..id)
return 1
end
Cs2d tibia tutorial ================ My new CS2D RPG Project Video
TDShuft has written:
@starkkz .. i dont know but seems you to be the rp script author o.O ,
can some one help with this :
Attempt to peform an Arithmetic on field '?' ( nil value )
//edit:
forget it my friend did got it already
can some one help with this :
Code:
1
rp_creds[id]=rp_creds[id]+player(id,[[money]])
Attempt to peform an Arithmetic on field '?' ( nil value )
//edit:
forget it my friend did got it already
Because i'm the author, and i didn't wanted to upload my script. the problem is, 2 persons uploaded it, and they said its by them. So if it is by them, you can ask them for help.
Starkkz has written:
Because i'm the author, and i didn't wanted to upload my script. the problem is, 2 persons uploaded it, and they said its by them. So if it is by them, you can ask them for help.
TDShuft has written:
@starkkz .. i dont know but seems you to be the rp script author o.O ,
can some one help with this :
Attempt to peform an Arithmetic on field '?' ( nil value )
//edit:
forget it my friend did got it already
can some one help with this :
Code:
1
rp_creds[id]=rp_creds[id]+player(id,[[money]])
Attempt to peform an Arithmetic on field '?' ( nil value )
//edit:
forget it my friend did got it already
Because i'm the author, and i didn't wanted to upload my script. the problem is, 2 persons uploaded it, and they said its by them. So if it is by them, you can ask them for help.
i dont need help of them and i hate them too
one of he name is "Chunks" Right ?
Sorry , I can't be Perfect !
07.10.10 01:22:12 pm
hei guis can they tell me how make join script
like join y200 x200 (to tiles)
like join y200 x200 (to tiles)
Create free website for your clan! Create server control panel webE --->http://www.000webhost.com/581961.html
Hi all I need a function which sorts a table alphabetically....
like in ...
(http://www.lua.org/pil/19.3.html)
But this script only works if the table looks like..
But I want that the function sorts tables like this....
help pls
like in ...
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
function pairsByKeys (t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
end
end
return iter
end
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
end
end
return iter
end
(http://www.lua.org/pil/19.3.html)
But this script only works if the table looks like..
Code:
1
table = {A = 78476,B = 64,C = 1} --sample
But I want that the function sorts tables like this....
Code:
1
table = {"Peter","John","Abba"}
help pls
[Death Note]