English return 1 wont Work

12 replies
Goto Page
To the start Previous 1 Next To the start
06.07.17 06:50:51 am
Up
baRD
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-------------------------
----Admin Commands v1----
------ by bardecon ------
-------------------------
Admin = {160589} -- Write here the usgn of the players who you want to be admin --

-- Say Hook1 --
addhook("say","sayCommand")
-- Admin Commands --

function sayCommand(id,txt)
for usgn in pairs(Admin) do
if (txt == "!sArmor") then      --!sArmour Command, gives admin super armour.--
parse("equip "..id.." superarmor")
msg2(id,"©255255000Super Armor Succesfully equiped!")
elseif (txt =="!rs") then      --!rs Command, resets your scores and deaths.--
if (player(id,"score")>0) or (player(id,"deaths")> 0) then
parse("setscore "..id.. " 0")
parse("setdeaths "..id.. " 0")
msg2(id,"©255255000Scores has succesfully reseted!")
return 1 --wont work plz help--
else
msg2(id,"©255255000You dont have scores yet!")
end
end
end
end

plz help me with this, return 1 wont work why?
06.07.17 07:06:09 am
Up
Cure Pikachu
User
Offline Off
Are you using any other scripts?
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
06.07.17 08:15:59 am
Up
Louie
User
Offline Off
You probably have another one of that hook somewhere, it won't work if you have multiple say hooks. Also, just a tip, do try tabbing your code as it can be a pain to read.
No system is safe.
06.07.17 09:31:02 am
Up
Mora_rus
User
Offline Off
You can use
\169
instead of
©
. It would surely ignore causes with A and dots over it if you ever had.
If you dont know what's tabbing: You have a key on your keyboard called "TAB". Click it to move your text each for each
for
and
end
and
if
and
while
and etc
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Admin = {114940} -- Write here the usgn of the players who you want to be admin --

-- Say Hook1 --
addhook("say","sayCommand")
-- Admin Commands --

function sayCommand(id,txt)
     for usgn in pairs(Admin) do
          if (txt == "!sArmor") then      --!sArmour Command, gives admin super armour.--
               parse("equip "..id.." superarmor")
               msg2(id,"\169255255000Super Armor Succesfully equiped!")
          return 1
          elseif (txt =="!rs") then      --!rs Command, resets your scores and deaths.--
               if (player(id,"score")>0) or (player(id,"deaths")> 0) then
                    parse("setscore "..id.. " 0")
                    parse("setdeaths "..id.. " 0")
                    msg2(id,"\169255255000Scores has succesfully reseted!")
               else
                    msg2(id,"\169255255000You dont have scores yet!")
               end
          return 1
          end
     end
end
07.07.17 02:57:36 am
Up
baRD
User
Offline Off
It still wont work.
And the A with dots on top still shows up.
But thx for posting though...
07.07.17 03:30:44 am
Up
Ortimh
User
Offline Off
I'm feeling good today.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-------------------------
----Admin Commands v1----
------ by bardecon ------
-------------------------
Admin = {160589} -- Write here the usgn of the players who you want to be admin --

-- Say Hook1 --
addhook("say","sayCommand")
-- Admin Commands --

function sayCommand(id,txt)
     for _, usgn in ipairs(Admin) do
          if (player(id,"usgn") == usgn) then
               if (txt == "!sArmor") then      --!sArmour Command, gives admin super armour.--
                    parse("equip "..id.." superarmor")
                    msg2(id,"\169255255000Super Armor Succesfully equiped!")
                    return 1
               elseif (txt =="!rs") then      --!rs Command, resets your scores and deaths.--
                    if (player(id,"score")>0) or (player(id,"deaths")> 0) then
                         parse("setscore "..id.. " 0")
                         parse("setdeaths "..id.. " 0")
                         msg2(id,"\169255255000Scores has succesfully reseted!")
                    else
                         msg2(id,"\169255255000You dont have scores yet!")
                    end
                    return 1
               end
               break
          end
     end
end
I'm awesome ... and I really like cookies.
07.07.17 07:30:56 am
Up
Mora_rus
User
Offline Off
No, my code was working perfectly. It's you have problems with hooks or smth else.
07.07.17 02:49:29 pm
Up
baRD
User
Offline Off
I realy need to make return 1 work...
07.07.17 03:03:15 pm
Up
GeoB
Moderator
Offline Off
@user baRD: You still haven't answered user Cure Pikachu's question though. Are you using any other scripts or not?
07.07.17 03:16:14 pm
Up
baRD
User
Offline Off
Yes i do use my own scripts and a admin script that i dont own....
I yet have 5 scripts...

fastbuild.lua
joinMsg.lua
Player_Shop_v.1.lua
spawnEquip.lua

and i have my admin script
in my other folder...
07.07.17 03:16:19 pm
Up
Yates
Reviewer
Offline Off
At the very beginning of the lua script, type
return 1


It works I guarantee it 10/10 √
07.07.17 04:03:23 pm
Up
baRD
User
Offline Off
@user Yates:
thx very much...
07.07.17 05:08:23 pm
Up
_3yrus
User
Offline Off
user baRD 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
24
25
26
27
-------------------------
----Admin Commands v1----
------ by bardecon ------
-------------------------
Admin = {160589} -- Write here the usgn of the players who you want to be admin --

-- Say Hook1 --
addhook("say","sayCommand")
-- Admin Commands --

function sayCommand(id,txt)
  for usgn in pairs(Admin) do
    if (txt == "!sArmor") then      --!sArmour Command, gives admin super armour.--
    parse("equip "..id.." superarmor")
    msg2(id,"©255255000Super Armor Succesfully equiped!")
  elseif (txt =="!rs") then      --!rs Command, resets your scores and deaths.--
    if (player(id,"score")>0) or (player(id,"deaths")> 0) then
      parse("setscore "..id.. " 0")
      parse("setdeaths "..id.. " 0")
      msg2(id,"©255255000Scores has succesfully reseted!")
      return 1 --wont work plz help--
    else
      msg2(id,"©255255000You dont have scores yet!")
    end
  end
end
end

plz help me with this, return 1 wont work why?


and also tab ur code , it would be more understandable
here we go !
To the start Previous 1 Next To the start