English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 200 201 202 ... 338 339 Next To the start
13.05.10 03:25:58 pm
Up
Szkieletor
User
Offline Off
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.
13.05.10 08:45:48 pm
Up
Redefinder
User
Offline Off
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.
13.05.10 11:36:52 pm
Up
Heartless Soldier
User
Offline Off
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.


Code:
1
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


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
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
edited 4×, last 14.05.10 12:03:19 am
14.05.10 05:47:52 am
Up
goweiwen
User
Offline Off
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
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
14.05.10 12:36:45 pm
Up
Szkieletor
User
Offline Off
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
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


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)
14.05.10 01:05:35 pm
Up
Redefinder
User
Offline Off
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
15.05.10 03:54:31 pm
Up
Sudden Death
User
Offline Off
I don't know how to change here
Spoiler >
Please change this to work
edited 1×, last 16.05.10 09:32:05 am
Sniffin'Man "If it cannot be done with lua, it must be you mama, coz she's too fat"
15.05.10 08:44:01 pm
Up
Precel97
User
Offline Off
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


16.05.10 03:03:37 pm
Up
Kostyan1996
User
Offline Off
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?
16.05.10 05:08:07 pm
Up
SkullFace
User
Offline Off
How do I make when I built barricade or wall,wall2,wall3 and then goes over it some sprite? Help anyone?
IMG:https://i.imgur.com/kZBVkjM.gif
P.S. - I've been extracting recently enviromental sound files from other games, if anyone is interested in them for adding them to their maps, scripts, PM me
16.05.10 07:20:11 pm
Up
Dig-Dog-HotDog
User
Offline Off
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
16.05.10 11:07:35 pm
Up
YellowBanana
BANNED
Offline Off
This should do the job.

Code:
1
2
3
4
5
function say(id,msg)
     if(msg == "!leave") then
          leavecar(id)
     end
end
Up
KenVo
User
Offline Off
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:

Code:
1
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}}, 
     },


I want to add more spawn for this monster and make it spawn faster so what i have to change?

17.05.10 08:40:48 am
Up
Night Till Death
User
Offline Off
the spawnchance is a place you need to edit.
17.05.10 04:52:40 pm
Up
DRoNe
User
Offline Off
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
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


i don't know with rcon_pw, sorry
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
17.05.10 05:04:26 pm
Up
Sudden Death
User
Offline Off
Omg what worng with my script? help me i can't change it, i don't understand lua in full >.>
Sniffin'Man "If it cannot be done with lua, it must be you mama, coz she's too fat"
17.05.10 08:06:06 pm
Up
Flacko
User
Offline Off
Intrusion has written:
Omg what worng with my script? help me i can't change it, i don't understand lua in full >.>

You just don't understand lua, so you will have to read tutorials, manuals, etc:

Programming in Lua: http://www.lua.org/pil/

Lua FAQ: http://lua-users.org/wiki/LuaFaq

Reference Manual: http://www.lua.org/manual/5.1/

Programming Gems (advanced): http://www.lua.org/gems/
17.05.10 08:24:50 pm
Up
Vectarrio
User
Offline Off
Dont forget about http://cs2d.org/
17.05.10 09:53:22 pm
Up
DRoNe
User
Offline Off
Code:
1
attempt to call a number value


pls one example for finding this error.
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
17.05.10 10:27:49 pm
Up
Soja1997
User
Offline Off
i got big problem

Spoiler >
To the start Previous 1 2 ... 200 201 202 ... 338 339 Next To the start