Forum

> > CS2D > Scripts > Five-Seven Teleport Lua
Forums overviewCS2D overview Scripts overviewLog in to reply

English Five-Seven Teleport Lua

12 replies
To the start Previous 1 Next To the start

old Five-Seven Teleport Lua

Leonidas12
User Off Offline

Quote
100%made me ..my lua

1
2
3
4
5
6
7
parse ("startround") msg("©255000000Lua Made By Neomage")

	for id =1, 32 do

addhook("hit" , "setpos")

		parse=hit ("wpnid 6") ..id.. ("setpos "..id.." X(130) Y(60) 6")

old Re: Five-Seven Teleport Lua

TimeQuesT
User Off Offline

Quote
Actually this won't work...

edit:

you have to define functions and hook them.

example:

1
2
3
4
5
addhook ("hit","lol");

function lol(PUTPARAMETERS HERE)

end
edited 1×, last 16.10.11 01:07:42 pm

old Re: Five-Seven Teleport Lua

Cure Pikachu
User Off Offline

Quote
He totally sucks at Lua.
You know, I am not going to give the code to someone who doesn't know the basics.
I mean, come on. Look at the script. It's not even close to Lua standard.
More >
edited 1×, last 16.10.11 01:10:52 pm

old Re: Five-Seven Teleport Lua

Leonidas12
User Off Offline

Quote
user TimeQuesT has written
Actually this won't work...

edit:

you have to define functions and hook them.

example:

1
2
3
4
5
addhook ("hit","lol");

function lol(PUTPARAMETERS HERE)

end


very very very very thanks

this is true:

1
2
3
4
5
6
7
8
9
parse ("startround") msg("©255000000Lua Made By Neomage")

	for id =1, 32 do

addhook("hit" , "setpos")

fuction setpos (" X(130) Y(60) 6 ")

end

old Re: Five-Seven Teleport Lua

TimeQuesT
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--hooks
addhook ("startround","a");
addhook ("hit","b");

--variables
wpnMainId = 0 -- put the weapon id here ;)

--functions
function a()

msg("©255000000 KREEEEBBSS!")

end

function b(id,src,wpn)

if (wpn==wpnMainId) then

parse ("setpos "..src.." "..player(id,"x").." "..player(id,"y"));

end

end

edit: ohh i forgott the functions in the hook thingy ;). I corrected it.
edited 1×, last 16.10.11 02:21:35 pm

old Re: Five-Seven Teleport Lua

Leonidas12
User Off Offline

Quote
user TimeQuesT has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--hooks
addhook ("startround");
addhook ("hit");

--variables
wpnMainId = 0 -- put the weapon id here ;)

--functions
function startround()

msg("©255000000 KREEEEBBSS!")

end

function hit(id,src,wpn)

if (wpn==wpnMainId) then

parse ("setpos "..src.." "..player(id,"x").." "..player(id,"y"));

end

end


this is error

the error code is:
1
LUA ERROR: sys/lua/iii.lua:2: '=' expected near 'addhook'

old Re: Five-Seven Teleport Lua

Kel9290
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--hooks
addhook ("startround","_hit");
addhook ("hit","_hit");

--variables
wpnMainId = 1 -- put the weapon id here ;) (1 is usp)

--functions
function startround()
	msg("©255000000 KREEEEBBSS!")
end

function hit(id,src,wpn)
	if (wpn==wpnMainId) then
		parse ("setpos "..src.." "..player(id,"x").." "..player(id,"y"));
	end
end

old Re: Five-Seven Teleport Lua

Cure Pikachu
User Off Offline

Quote
user Kel9290 , you forgot something.

Here's the correct version:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- hooks
addhook("startround","telemsg")
addhook("hit","telego")

-- variables
tilex = 130
tiley = 60

-- functions
function telemsg()
	msg("©255000000Lua Made By Neomage")
end

function telego(id,src,wpn)
	if wpn == 6 then
		-- I assume the position given are in tiles, so...
		local rx = (tilex*32)+16
		local ry = (tiley*32)+16
		parse("setpos "..id.." "..rx.." "..ry)
	end
end

old Re: Five-Seven Teleport Lua

Leonidas12
User Off Offline

Quote
user Cure Pikachu has written
user Kel9290 , you forgot something.

Here's the correct version:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- hooks
addhook("startround","telemsg")
addhook("hit","telego")

-- variables
tilex = 130
tiley = 60

-- functions
function telemsg()
	msg("©255000000Lua Made By Neomage")
end

function telego(id,src,wpn)
	if wpn == 6 then
		-- I assume the position given are in tiles, so...
		local rx = (tilex*32)+16
		local ry = (tiley*32)+16
		parse("setpos "..id.." "..rx.." "..ry)
	end
end


VERY THANKS MY LUA (MY FİRST LUA İS RUNNİNG)

you or 1 error its .©255000000Lua Made By Neomage message is startround message

İTS WORKİNG
edited 1×, last 17.10.11 09:03:28 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview