English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 223 224 225 ... 338 339 Next To the start
25.07.10 12:38:26 pm
Up
Rainoth
Moderator
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","buildings")
function around(id,txt)
     if txt == "!around" then
     if (player(id,"money")>14999) then
          parse("spawnobject 8 "..(player(id,"tilex")+1).." "..player(id,"tiley")+1).." 0 0 "..player(id,"team").." "..id)
       parse("spawnobject 8 "..(player(id,"tilex")+1).." "..player(id,"tiley")-1).." 0 0 "..player(id,"team").." "..id)
       parse("spawnobject 8 "..(player(id,"tilex")-1).." "..player(id,"tiley")+1).." 0 0 "..player(id,"team").." "..id)
       parse("spawnobject 8 "..(player(id,"tilex")-1).." "..player(id,"tiley")-1).." 0 0 "..player(id,"team").." "..id)
       parse("spawnobject 6 "..(player(id,"tilex")+1).." "..player(id,"tiley")+0).." 0 0 "..player(id,"team").." "..id)
       parse("spawnobject 6 "..(player(id,"tilex")+0).." "..player(id,"tiley")+1).." 0 0 "..player(id,"team").." "..id)
       parse("spawnobject 6 "..(player(id,"tilex")-1).." "..player(id,"tiley")+0).." 0 0 "..player(id,"team").." "..id)
       parse("spawnobject 6 "..(player(id,"tilex")+0).." "..player(id,"tiley")-1).." 0 0 "..player(id,"team").." "..id)
       parse("setmoney "..id.." "..player(id,"money")-15000)
      end
end


Error : unexpected simbol near ".." in 5th line
I don't see wrong simbols...
MAL • DeviantArt • For Wallpaper Engine users • Check YT for playlists... •
25.07.10 04:19:51 pm
Up
HaRe
User
Offline Off
i need a script when

Code:
1
wallwalker[id]==1


the wallwalker can walk trought walls.
w0w im so eXotiK
25.07.10 04:59:18 pm
Up
VegBerg
User
Offline Off
As all of you previous readers of my posts know, I'm very bad in Lua. So I wonder, is it possible to make a Google Translate script so you can say e.g. "!nor-eng <meaage here> that translates from Norwegian to English, and also other languages

If you want to make a script like that to me or help me you should get the credits for it
25.07.10 05:24:09 pm
Up
Adollo
User
Offline Off
Does anybody know how to make better timer?
25.07.10 05:28:50 pm
Up
HaRe
User
Offline Off
Adollo has written:
Does anybody know how to make better timer?


Code:
1
2
3
4
5
6
7
8
9
10
11
12
_timer=0

addhook("second","timersec") -- change second to minute if u want it to be every minute
function timersec()
_timer=_timer+1
     if _timer==1 then -- if timer is 1 then
          msg2(id,"timer is 1 omg")
          _timer=_timer+1
     elseif _timer==10 then - if timer is 10 then timer go down to 1 again
          _timer=0
     end
end
w0w im so eXotiK
25.07.10 05:33:22 pm
Up
Snake_Eater
User
Offline Off
@ batlaizys

try this

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","buildings")
function buildings(id,txt)
tx=player(id,"tilex")
ty=player(id,"tiley")
if txt == "!around" then
parse("spawnobject 8 "..(tx+1).." "..(ty+1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 8 "..(tx+1).." "..(ty-1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 8 "..(tx-1).." "..(ty+1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 8 "..(tx-1).." "..(ty-1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 6 "..(tx+1).." "..(ty+0).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 6 "..(tx+0).." "..(ty+1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 6 "..(tx-1).." "..(ty+0).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 6 "..(tx+0).." "..(ty-1).." 0 0 "..player(id,"team").." "..id)
end
end
[Death Note]
25.07.10 05:35:46 pm
Up
Adollo
User
Offline Off
@vesa-omar: Thanks!
25.07.10 05:38:22 pm
Up
HaRe
User
Offline Off
Snake_Eater has written:
@ batlaizys

try this

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","buildings")
function buildings(id,txt)
tx=player(id,"tilex")
ty=player(id,"tiley")
if txt == "!around" then
parse("spawnobject 8 "..(tx+1).." "..(ty+1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 8 "..(tx+1).." "..(ty-1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 8 "..(tx-1).." "..(ty+1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 8 "..(tx-1).." "..(ty-1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 6 "..(tx+1).." "..(ty+0).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 6 "..(tx+0).." "..(ty+1).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 6 "..(tx-1).." "..(ty+0).." 0 0 "..player(id,"team").." "..id)
parse("spawnobject 6 "..(tx+0).." "..(ty-1).." 0 0 "..player(id,"team").." "..id)
end
end


You forgot the money

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
addhook("say","buildings")
function buildings(id,txt)
tx=player(id,"tilex")
ty=player(id,"tiley")
     if txt == "!around" then
          if (player(id,"money")>4999) then
               parse("spawnobject 8 "..(tx+1).." "..(ty+1).." 0 0 "..player(id,"team").." "..id)
               parse("spawnobject 8 "..(tx+1).." "..(ty-1).." 0 0 "..player(id,"team").." "..id)
               parse("spawnobject 8 "..(tx-1).." "..(ty+1).." 0 0 "..player(id,"team").." "..id)
               parse("spawnobject 8 "..(tx-1).." "..(ty-1).." 0 0 "..player(id,"team").." "..id)
               parse("spawnobject 6 "..(tx+1).." "..(ty+0).." 0 0 "..player(id,"team").." "..id)
               parse("spawnobject 6 "..(tx+0).." "..(ty+1).." 0 0 "..player(id,"team").." "..id)
               parse("spawnobject 6 "..(tx-1).." "..(ty+0).." 0 0 "..player(id,"team").." "..id)
               parse("spawnobject 6 "..(tx+0).." "..(ty-1).." 0 0 "..player(id,"team").." "..id)
               msg2(id,"Youve builded the Around Base")
               parse("setmoney "..id.." "..player(id,"money") - 5000)
               return 1
          else
               msg2(id,"You dont have enough money")
               return 1
          end
     end
end


/edit

i need a script when you walkover a claw then it strips an HE

/edit

nvm dont need anymore
edited 3×, last 25.07.10 09:57:46 pm
w0w im so eXotiK
25.07.10 10:03:06 pm
Up
Soja1997
User
Offline Off
Hi i need script on standart game mode
only TT Can use this script CT Cant
iF TT Say !spawn
he got spawn on pos x y z
25.07.10 10:13:59 pm
Up
HaRe
User
Offline Off
Soja1997 has written:
Hi i need script on standart game mode
only TT Can use this script CT Cant
iF TT Say !spawn
he got spawn on pos x y z

there u go
Code:
1
2
3
4
5
6
7
8
9
addhook("say","saytt")
function saytt(id,txt)
     if (player(id,"team") == 1) then
          if txt=="!spawn" then
               parse("spawnplayer "..id.." X Y")
               return 1
          end
     end
end


So i need help with this script

Code:
1
2
3
4
5
6
7
8
9
10
addhook("drop","dropknife_dropcheck")
function dropknife_dropcheck(id,iid,type,ain,a,mode,x,y)
     if knife[id]==1 then
          parse("strip "..id.." 50")
          parse("equip "..id.." 78")
          parse("setweapon "..id.." 78")
     elseif knife[id]==0 then
          return 0
     end
end


it wont work i need if knife[id]==1 then it strips the players knife and equips an claw and sets the claw as the players weapon
w0w im so eXotiK
25.07.10 10:20:52 pm
Up
Soja1997
User
Offline Off
wait i test script ;P
LUA ERROR: sys/lua/tt.lua:5: 'then' expected near 'parse'
Code:
1
2
3
4
5
6
7
8
9
addhook("say","saytt")
function saytt(id,txt)
     if (player(id,"team") == 1) then
          if txt=="!spawn tt"
               parse("spawnplayer "..id.." 48 750")
               return 1
          end
     end
end

you script here but if you drop claw you got knife ;/ you can make script cant drop claw ;]
Code:
1
2
3
4
5
6
addhook("spawn","clawtoknife")
function clawtoknife(id)
          parse ("equip "..id.." 78")
          parse ("setweapon "..id.." 78")
          parse ("strip "..id.." 50")
     end
25.07.10 10:32:21 pm
Up
HaRe
User
Offline Off
Soja1997 has written:
wait i test script ;P
LUA ERROR: sys/lua/tt.lua:5: 'then' expected near 'parse'
Code:
1
2
3
4
5
6
7
8
9
addhook("say","saytt")
function saytt(id,txt)
     if (player(id,"team") == 1) then
          if txt=="!spawn tt"
               parse("spawnplayer "..id.." 48 750")
               return 1
          end
     end
end

you script here but if you drop claw you got knife ;/ you can make script cant drop claw ;]
Code:
1
2
3
4
5
6
addhook("spawn","clawtoknife")
function clawtoknife(id)
          parse ("equip "..id.." 78")
          parse ("setweapon "..id.." 78")
          parse ("strip "..id.." 50")
     end


Code:
1
2
3
4
5
6
7
8
9
addhook("say","saytt")
function saytt(id,txt)
if (player(id,"team") == 1) then
if txt=="!spawn tt" then
parse("spawnplayer "..id.." 48 750")
return 1
end
end
end


and i didnt mean that, I meant if knife[id]==1 then it strips the players knife and equips an claw and sets the claw as the players weapon
w0w im so eXotiK
25.07.10 10:35:55 pm
Up
Soja1997
User
Offline Off
first test my script is works
Code:
1
2
3
4
5
6
7
8
9
addhook("say","saytt")
function saytt(id,txt)
     if (player(id,"team") == 1) then
          if txt=="!spawn tt"
               parse ("spawnplayer "..id.." 48 750")
               return 1
          end
     end
end

here is error
Code:
1
LUA ERROR: sys/lua/tt.lua:5: 'then' expected near 'parse'
25.07.10 10:46:06 pm
Up
HaRe
User
Offline Off
Soja1997 has written:
first test my script is works
Code:
1
2
3
4
5
6
7
8
9
addhook("say","saytt")
function saytt(id,txt)
     if (player(id,"team") == 1) then
          if txt=="!spawn tt"
               parse ("spawnplayer "..id.." 48 750")
               return 1
          end
     end
end

here is error
Code:
1
LUA ERROR: sys/lua/tt.lua:5: 'then' expected near 'parse'


ive already fixed it omg

Code:
1
2
3
4
5
6
7
8
9
addhook("say","saytt")
function saytt(id,txt)
if (player(id,"team") == 1) then
if txt=="!spawn tt" then
parse("spawnplayer "..id.." 48 750")
return 1
end
end
end
w0w im so eXotiK
26.07.10 11:59:20 am
Up
Alex_Aaa789
User
Offline Off
parse colorsmoke wont work
Code:
1
parse('effect "colorsmoke" '..x..' '..y..' 140 96 0 0 0)


But it comes an error that ')' is expected near 'colorsmoke'

Is it possible to be fix?
[ToW Co-Leader]Aaa789 IMG:http://i302.photobucket.com/albums/nn92/aaa789_alexlaw4/Untitled8.gif
Oh it was ended already
26.07.10 12:01:43 pm
Up
DC
Admin
Offline Off
check your quotes again. there is a ' missing in front of the )
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
26.07.10 12:07:07 pm
Up
HaRe
User
Offline Off
Alex_Aaa789 has written:
parse colorsmoke wont work
Code:
1
parse('effect "colorsmoke" '..x..' '..y..' 140 96 0 0 0)


But it comes an error that ')' is expected near 'colorsmoke'

Is it possible to be fix?


Code:
1
parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 0')
w0w im so eXotiK
26.07.10 12:08:47 pm
Up
Alex_Aaa789
User
Offline Off
fixed, thanks
edited 1×, last 26.07.10 12:10:36 pm
[ToW Co-Leader]Aaa789 IMG:http://i302.photobucket.com/albums/nn92/aaa789_alexlaw4/Untitled8.gif
Oh it was ended already
26.07.10 12:09:53 pm
Up
HaRe
User
Offline Off
Alex_Aaa789 has written:
fixed
But why ) still expected near colorsmoke?


you didnt put an ' in the end

Mine:
Code:
1
')

Yours:
Code:
1
)
w0w im so eXotiK
26.07.10 12:23:49 pm
Up
Alex_Aaa789
User
Offline Off
Omg, now it keeps spamming
Code:
1
LUA ERROR: attempt to call a nil value


My full lua:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook("hit","heal")
function healgun(id,source,wpn,hpdmg,apdmg,x,y)
local x, y
x = player( id, "x")
y = player( id, "y")
     if wpn == 2 then
          parse("sethealth "..id.." "..player(id,"health")+10)
          parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 255 192 203')
          parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 128 0 128')
            msg2(id,"You got healed by "..player(p,"name").."")
          return 1
     end
     if wpn == 1 then
          parse("setpos "..id.." 544 1888")
          parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 0')
          parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 139')
            msg2(id,"You got jailed by "..player(p,"name").."")
            return 1
     end
end


I should add what to stop that calling nil value?
[ToW Co-Leader]Aaa789 IMG:http://i302.photobucket.com/albums/nn92/aaa789_alexlaw4/Untitled8.gif
Oh it was ended already
To the start Previous 1 2 ... 223 224 225 ... 338 339 Next To the start