English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 208 209 210 ... 338 339 Next To the start
15.06.10 05:33:48 pm
Up
TimeQuesT
User
Offline Off
you want to sent a message?

msg ("hello")
this easy command will show a message "hello" at the screen
Muh
15.06.10 06:42:38 pm
Up
mhd111
User
Offline Off
lol no man i meant send me a personal msg.
15.06.10 06:43:49 pm
Up
DRoNe
User
Offline Off
lol and whats the problem ?
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
15.06.10 07:58:59 pm
Up
Jermuk
User
Offline Off
Hello all,

I have a supid problem. My script works with "New game" fine, but when I try it on a dedicated server it fails. First I thought that it is a script problem but then i tried this:
Code:
1
2
3
4
5
6
7
addhook ("usebutton", "onusebutton")
function onusebutton(id,x,y)
     msg("ICH MAG DONER");
     .
     .
     .
end


With dedicated it don't display "Ich mag Doner", wich means, that the server don't call the "usebutton" hook. When I start a game with 'New game' it works fine, but just when I press a button. When other press a button, it don't work. Anyone else with the same problem and know the solution?

Thank you!

Jermuk aka Dönarmaster
15.06.10 08:51:14 pm
Up
Flacko
User
Offline Off
Homer has written:
Alright, I've seen a lot of scripts with colons in their functions, is that just a way of naming it, or does it have some meaning to it?


Use it like this:
Code:
1
2
3
4
5
a = {x = 3}
function a:lol()
     print(self.x)
end
a:lol()

Output has written:
3


Code:
1
2
3
4
5
6
--WRONG--
a = {x=3}
function a.lol()
     print(self.x)
end
a.lol()

Output has written:
attempt to index global 'self'


This also works for metatables, so you don't have to copy your function more than once for different objects.
Code:
1
2
3
4
5
6
7
8
9
mt = {}
mt.__index = mt

function mt:lol()
     print(self.x)
end

a = setmetatable({x=99},mt)
a:lol()

Output has written:
99
15.06.10 11:56:48 pm
Up
Homer
User
Offline Off
Thanks Flacko, I'm still iffy on some stuff but I suppose that just takes practice. Also, could someone supply me with a link to a tutorial on metatable usage, and yes I do know that there have been links previously given on this, but I've been searching for a while and haven't come across one. Thanks
I detest that man who hides one thing in the depths of his heart, and speaks for another.
16.06.10 05:11:58 pm
Up
Sudden Death
User
Offline Off
Its possible for make image in lua for only player, who trigged it can see it?
Sniffin'Man "If it cannot be done with lua, it must be you mama, coz she's too fat"
16.06.10 06:20:23 pm
Up
Soja1997
User
Offline Off
function InArea(XY,X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,Y5,X6,Y6,X7,Y7)
return( XY.X > X1 and XY.X < X2 and XY.Y > Y1 and XY.Y < Y2 > X3 and XY.X < X4 and XY.Y > Y3 and XY.Y < Y4 > X5 and XY.X < X6 and XY.Y > Y5 and XY.Y < Y6 )
end
Here is error ;/
16.06.10 06:55:46 pm
Up
DRoNe
User
Offline Off
Intrusion has written:
Its possible for make image in lua for only player, who trigged it can see it?


The one way is only mode 2 for hud image.
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
16.06.10 07:03:17 pm
Up
Flacko
User
Offline Off
Intrusion has written:
Its possible for make image in lua for only player, who trigged it can see it?


http://www.unrealsoftware.de/forum_posts.php?post=120848&start=4040#post182680
16.06.10 07:07:51 pm
Up
SQ
Moderator
Offline Off
Soja1997 has written:
function InArea(XY,X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,Y5,X6,Y6,X7,Y7)
return( XY.X > X1 and XY.X < X2 and XY.Y > Y1 and XY.Y < Y2 > X3 and XY.X < X4 and XY.Y > Y3 and XY.Y < Y4 > X5 and XY.X < X6 and XY.Y > Y5 and XY.Y < Y6 )
end
Here is error ;/


Why do you need so many X,Y?
What a hell you're planing to do with this football function?

...and you did syntax mistake.
More >
17.06.10 02:05:03 am
Up
HaNwKs
User
Offline Off
that the ball appears only for me and others not?
IMG:http://miniprofile.xfire.com/bg/sh/type/2/hanwks.png
17.06.10 01:03:17 pm
Up
Refresh
User
Offline Off
Hi guys I have a Tibia server and I know the bug if you buy a leather helmet for 100 money, and you sell it, you get 300 money. How can I fix it?
17.06.10 02:11:15 pm
Up
Jermuk
User
Offline Off
@Levic

Maybe you should tell it to the programmer of Tibia or post the code piece here.
17.06.10 05:05:43 pm
Up
Refresh
User
Offline Off
Okay. I saw an other thing on servers with the rpg_mapb4.5 map. They have a modded script with new items, monsters etc. Where can I download that? thx
17.06.10 05:17:44 pm
Up
DrPyromatic
User
Offline Off
Levic has written:
Okay. I saw an other thing on servers with the rpg_mapb4.5 map. They have a modded script with new items, monsters etc. Where can I download that? thx

You cant actually, but you can may ask the hoster from the servers if they send you the changed lua files.
17.06.10 07:05:20 pm
Up
Soja1997
User
Offline Off
I must have script
if USGN 16001 says
CTKarny LoadBall Pos X,Y
TTKarny LoadBall Pos X,Y
and Fuction
Overclock ball Right 45o On button p
Overclock ball Left 45o On button l
edited 1×, last 17.06.10 07:42:49 pm
18.06.10 02:02:17 am
Up
KenVo
User
Offline Off
How to get more score with 1 kill, and make zombie die (after I kill it) until the new round start ?
18.06.10 08:23:10 pm
Up
Dragon fang
User
Offline Off
I am making a TF2 lua, I finished most of it.
But I can't make the medic's laser heal I tried to write a script:

addhook("hit","laser_heal")
function laser_heal(id,source,weapon,hpdmg,apdmg)
if(weapon == 45) then
parse ("sethealth "..id.." "..player(id,"health")+30)
end

It dosen't work, Can someone point the error for me?

And is it possible for no knife? I wanted the spy only having a knife since I made the secondary hit instant kill.
18.06.10 08:30:58 pm
Up
TimeQuesT
User
Offline Off
end expected

(write an end at the end Oo)
Muh
To the start Previous 1 2 ... 208 209 210 ... 338 339 Next To the start