English Make a players walk reverse

4 replies
Goto Page
To the start Previous 1 Next To the start
14.09.17 12:45:00 am
Up
Promaster
User
Offline Off
I need help with creating a curse that make a player walk reverse. Like when they want to walk up, they walks down, and instead of down they are walking up. the same goes for left and right.
edited 1×, last 14.09.17 02:06:35 am
IMG:https://www.f2pmmogs.com/wp-content/themes/twentytwelve/images/logo-lunia.png
14.09.17 01:21:11 pm
Up
ajm-sh
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
posx={}

addhook("join","_j")
function _j(id)
posx[id]={}
posx[id][1]=1
end

addhook("move","_m")
function _m(id,x,y)
table.insert(posx[id],x)
local lol = x-10
if posx[id][#posx[id]]>posx[id][#posx[id]-1] then
parse("setpos "..id.." "..lol.." "..y.."")
end
end



With 1 condition which will make the player move left when he is trying to move right. Add more conditions. Laggy maybe.
16.09.17 12:07:14 am
Up
Promaster
User
Offline Off
@user ajm-sh: Thank you for the answer. To be honest with you, i do not understand the why you did

Code:
1
if posx[id][#posx[id]]>posx[id][#posx[id]-1] then


Can you please add the rest condition for me.
IMG:https://www.f2pmmogs.com/wp-content/themes/twentytwelve/images/logo-lunia.png
18.09.17 12:56:14 pm
Up
ajm-sh
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
posx={}
posy={}

addhook("join","_j")
function _j(id)
posx[id]={}
posy[id]={}
posx[id][1]=1
posy[id][1]=1
end

addhook("move","_m")
function _m(id,x,y)
table.insert(posx[id],x)
table.insert(posy[id],y)
local nq = x-10
local sq = x+10
if posy[id][#posy[id]]==posy[id][#posy[id]-1] then
     if posx[id][#posx[id]]>posx[id][#posx[id]-1] then
          table.insert(posx[id],nq)
          parse("setpos "..id.." "..nq.." "..y.."")
     else
          table.insert(posx[id],sq)
     parse("setpos "..id.." "..sq.." "..y.."")
     end
end
local mm = y-10
local em = y+10
if posx[id][#posx[id]]==posx[id][#posx[id]-1] then
     if posy[id][#posy[id]]>posy[id][#posy[id]-1] then
          table.insert(posy[id],mm)
          parse("setpos "..id.." "..x.." "..mm.."")
     else
          table.insert(posy[id],em)
     parse("setpos "..id.." "..x.." "..em.."")
     end
end
end
18.09.17 04:21:58 pm
Up
_px 20
GAME BANNED
Offline Off
Not effective in my opinion, how about diagonal directions?
To the start Previous 1 Next To the start