Lua Scripts/Questions/Help
6,774 repliesinfo.txt has written:
hit(id,source,weapon,hpdmg,apdmg) on hit/damage
-id: player id
-source: source player id or 0
-weapon: weapon type / source type id
-hpdmg: caused damage (health)
-apdmg: caused damage (armor)
>return: 0 - proceed normally
1 - ignore this hit (no damage)
-id: player id
-source: source player id or 0
-weapon: weapon type / source type id
-hpdmg: caused damage (health)
-apdmg: caused damage (armor)
>return: 0 - proceed normally
1 - ignore this hit (no damage)
As you can see, the "source" parameter is the ID of the shooting player
@gabpro,thanks.
Better than nothing,right?
gabpro has written:
Not very useful but I think that can do it
Better than nothing,right?
@Arctic and TheKilledDeath
I try it,but dont work :x
Well,I will test again...
EDIT : Yeah!Some errors in LUA,then i FIX it and works *-*
Thanks!
@redefinder
Yeah
Quote:
-source: source player id or 0
I try it,but dont work :x
Well,I will test again...
EDIT : Yeah!Some errors in LUA,then i FIX it and works *-*
Thanks!
@redefinder
Quote:
Better than nothing,right?
Yeah
edited 1×, last 12.05.10 05:53:42 pm
I need help to change the limit of setmaxhealth to make a zombie mod(similar to the blazzingxx zombie plague classes)
0ito has written:
I need help to change the limit of setmaxhealth to make a zombie mod(similar to the blazzingxx zombie plague classes)
There is no way to change setmaxhealth limit. It's 250 and nothing will change it. Blazingxx mod uses another container for health, asking him if you can cut this part of script from his mod will be easiest way.
How to make a script that when typed !moneylist shows the money of all players?
Also does anyone have an idea on how to make: !setspawnpos and then teleport the player with !teleportme.
Any help is appreciated.
Thank you.
Also does anyone have an idea on how to make: !setspawnpos and then teleport the player with !teleportme.
Any help is appreciated.
Thank you.
redefinder has written:
How to make a script that when typed !moneylist shows the money of all players?
Also does anyone have an idea on how to make: !setspawnpos and then teleport the player with !teleportme.
Any help is appreciated.
Thank you.
Also does anyone have an idea on how to make: !setspawnpos and then teleport the player with !teleportme.
Any help is appreciated.
Thank you.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("say","onsay")
function onsay(id,message)
if message=="!moneylist" then
for i = 1,32 do
if player(i,"exists") then
local iname = player(i,"name")
local imoney = player(i,"money")
parse('sv_msg2 '..id..' '..iname..' has: '..imoney)
end
end
end
end
function onsay(id,message)
if message=="!moneylist" then
for i = 1,32 do
if player(i,"exists") then
local iname = player(i,"name")
local imoney = player(i,"money")
parse('sv_msg2 '..id..' '..iname..' has: '..imoney)
end
end
end
end
Here you are
Explain a bit "!setspawnpos"
EDIT: If I understand what you are thinking to do, don't you think would be better do this:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("say","onsay")
function onsay(id,message)
for i = 1,32 do
if message==("!teleportme "..i) then
local ix = player(i,"x")
local iy = player(i,"y")
parse('setpos '..id..' '..ix..' '..iy)
end
end
end
--Command:: !teleportme IDofPlayer
function onsay(id,message)
for i = 1,32 do
if message==("!teleportme "..i) then
local ix = player(i,"x")
local iy = player(i,"y")
parse('setpos '..id..' '..ix..' '..iy)
end
end
end
--Command:: !teleportme IDofPlayer
edited 4×, last 14.05.10 12:03:19 am
For your teleport thing,
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local spawnpos = {}
addhook("say","onSay")
function onSay(id,message)
if message == "!setspawnpos" then
spawnpos[id] = {player(id, 'x'), player(id, 'y')}
--[[
elseif message == "!resetspawn" then
onLeave(id)
]]
elseif message == "!teleportme" then
if spawnpos[id] then
parse("setpos " .. id .. " " .. spawnpos[id][1] .. " " .. spawnpos[id][2])
else
msg2(id, "You have not set a spawn position, use !setspawnpos to set one.")
end
end
end
addhook("leave", "onLeave")
function onLeave(id)
spawnpos[id] = nil
end
addhook("say","onSay")
function onSay(id,message)
if message == "!setspawnpos" then
spawnpos[id] = {player(id, 'x'), player(id, 'y')}
--[[
elseif message == "!resetspawn" then
onLeave(id)
]]
elseif message == "!teleportme" then
if spawnpos[id] then
parse("setpos " .. id .. " " .. spawnpos[id][1] .. " " .. spawnpos[id][2])
else
msg2(id, "You have not set a spawn position, use !setspawnpos to set one.")
end
end
end
addhook("leave", "onLeave")
function onLeave(id)
spawnpos[id] = nil
end
weiwen has written:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local spawnpos = {}
addhook("say","onSay")
function onSay(id,message)
if message == "!setspawnpos" then
spawnpos[id] = {player(id, 'x'), player(id, 'y')}
--[[
elseif message == "!resetspawn" then
onLeave(id)
]]
elseif message == "!teleportme" then
if spawnpos[id] then
parse("setpos " .. id .. " " .. spawnpos[id][1] .. " " .. spawnpos[id][2])
else
msg2(id, "You have not set a spawn position, use !setspawnpos to set one.")
end
end
end
addhook("leave", "onLeave")
function onLeave(id)
spawnpos[id] = nil
end
addhook("say","onSay")
function onSay(id,message)
if message == "!setspawnpos" then
spawnpos[id] = {player(id, 'x'), player(id, 'y')}
--[[
elseif message == "!resetspawn" then
onLeave(id)
]]
elseif message == "!teleportme" then
if spawnpos[id] then
parse("setpos " .. id .. " " .. spawnpos[id][1] .. " " .. spawnpos[id][2])
else
msg2(id, "You have not set a spawn position, use !setspawnpos to set one.")
end
end
end
addhook("leave", "onLeave")
function onLeave(id)
spawnpos[id] = nil
end
Is there a way to make this an RCON only console command? Or just make this command available only when certain value is true(ex. Cansetspawn = 1)
N-B-K has written:
Explain a bit "!setspawnpos"
I mean a player types !setspawnpos and then the script remembers his saved position until he disconnects,then he can use !teleportme and if he has atleast 4000$ money he will be teleported.
Anyways,thanks for the moneylist script
I don't know how to change here Please change this to work
edited 1×, last 16.05.10 09:32:05 am
SoRRy FoR mY p00r EngLisH
Hi, im new scripter
I wanna create worms mode.
Who can help me in this script :
Ufo - If you throw gas granade and if you hurt other player then he change to ufo .
Who can create example menu for me??
Help plz
I wanna create worms mode.
Who can help me in this script :
Ufo - If you throw gas granade and if you hurt other player then he change to ufo .
Who can create example menu for me??
Help plz
16.05.10 03:03:37 pm
Who knew such a script, where if a player joins a CT, it becomes a T, but if the player entered RCON password, or he ADMIN, it can become CT?
How do I make when I built barricade or wall,wall2,wall3 and then goes over it some sprite? Help anyone?
im making an Rpg script and there are cars and boats in them so I have 2 questions :
1.Could some1 write me a code so that when I write "!leave" the player would get out of the car (the same with boat)
2.could some1 write me a code that a certain vehicle could only be in water
1.Could some1 write me a code so that when I write "!leave" the player would get out of the car (the same with boat)
2.could some1 write me a code that a certain vehicle could only be in water
16.05.10 11:57:14 pm
I downloaded script CS2DTibia - RPG in: http://www.unrealsoftware.de/forum_posts.php?post=176932&start=0 and don't know how to add more monster to the map
Example:
I want to add more spawn for this monster and make it spawn faster so what i have to change?
Example:
Code:
1
2
3
4
5
2
3
4
5
{
name = 'Caterpie', health = 100, image = 'gfx/weiwen/pokemon/10.png', scalex = 1.5, scaley = 1.5, r = 104, g = 152, b = 40,
atk = 1.1, def = 1.2, spd = 7, atkspd = 10, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 100, runat = 20, spawn1 = {62, 70}, spawn2 = {150, 150},
exp = 5, money = 80, loot = {{chance = 8000, id = 1}},
},
name = 'Caterpie', health = 100, image = 'gfx/weiwen/pokemon/10.png', scalex = 1.5, scaley = 1.5, r = 104, g = 152, b = 40,
atk = 1.1, def = 1.2, spd = 7, atkspd = 10, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 100, runat = 20, spawn1 = {62, 70}, spawn2 = {150, 150},
exp = 5, money = 80, loot = {{chance = 8000, id = 1}},
},
I want to add more spawn for this monster and make it spawn faster so what i have to change?
Cs2d tibia tutorial ================ My new CS2D RPG Project Video
Kostyan1996 has written:
Who knew such a script, where if a player joins a CT, it becomes a T, but if the player entered RCON password, or he ADMIN, it can become CT?
you mean this ? :
Code:
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
addhook("team","adminteam")
function adminteam(id)
local usgn = player(id,"usgn")
if usgn == HERE YOUR,FRIEND USGN then
if team == 2 then
parse("makect "..id)
else
parse("maket "..id)
end
end
end
function adminteam(id)
local usgn = player(id,"usgn")
if usgn == HERE YOUR,FRIEND USGN then
if team == 2 then
parse("makect "..id)
else
parse("maket "..id)
end
end
end
i don't know with rcon_pw, sorry












