please help... Forum
Scripts
Tibia Beg Kick!
Tibia Beg Kick!
8 replies
1

please help... 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
elseif command =='y' then
	local target = tonumber(words:sub(4))
	local ip = player(target,"ip")
	local usgn = player(target,"usgn")
	if target then
		if player(target,'exists') then
			if target == id then
				msg2(id,'You may not temp. ban yourself!')
			end
			parse("banip "..ip.." 1440")
			parse("banusgn "..usgn.." 1440")
			return 1
		end
	end
	msg2(id,'Temp. ban IP and U.S.G.N.: "!y <targetid>"')
	return 1
end
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
addhook("say","canihaz",-999)
function canihaz(id,t)
	begs = {"can i have","can i haz","can you give me","can you giv me","can you fuck me","please give me","pls giv me","no kill pls","be frends k?","open dor"}
	t = t:lower()
	for _,o in pairs(begs) do
		if string.find(t,o) then
			msg(player(id,"name").." got kicked for begging!");
			parse("kick "..id.." \"Don't beg\"");
			break;
		end
	end
	return 1;
end
This one works, add more sentences (if you want) in the begs table.
Just check it manualy, and ban/kick/temp.ban them
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
beg={
"fuck",
"gay",
"nb"}
addhook("say","bed",9)
function bed(id,t)
for _,word in pairs(beg) do
if t:lower():match(word) then
parse("kick '..id..' "Don't Beg Please!")
msg("©255000000 "..player(id,"name").." got Kicked for Begging !!!")
return 1
end
end
end
Fine Works !
edited 1×, last 19.11.12 06:44:27 pm
Blairstring has written
1
addhook("say","canihaz",-999)
SheeL has written
1
addhook("say","bed",9)
Why should be there a number?
1
-999
or
1
9
sheeL has writtenLike This?
Fine Works !
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
beg={
"fuck",
"gay",
"nb"}
addhook("say","bed",9)
function bed(id,t)
for _,word in pairs(begl) do
if t:lower():match(word) then
parse("kick '..id..' "Don't Beg Please!")
msg("©255000000 "..player(id,"name").." got Kicked for Begging !!!")
return 1
end
end
end
Fine Works !
you made a typo
1
for _,word in pairs(begl) do
shouldn't it be
pairs(beg)
Trotskygrad has written
sheeL has writtenLike This?
Fine Works !
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
beg={
"fuck",
"gay",
"nb"}
addhook("say","bed",9)
function bed(id,t)
for _,word in pairs(begl) do
if t:lower():match(word) then
parse("kick '..id..' "Don't Beg Please!")
msg("©255000000 "..player(id,"name").." got Kicked for Begging !!!")
return 1
end
end
end
Fine Works !
you made a typo
1
for _,word in pairs(begl) do
shouldn't it be
pairs(beg)
sorry, my mistake
Suprise has written Blairstring has written
1
addhook("say","canihaz",-999)
SheeL has written
1
addhook("say","bed",9)
Why should be there a number?
1
-999
or
1
9
It's the priority the hook uses to react in the case of a message from a player (means it will be the last hook 'say' (if there are others) to execute). I've put to it -999 because it's not that important, so everybody can see what he wrote to check why he got kicked. If my hook had a high priority it will kick before everyone see the message of the kicked player. If you don't understand PM me and I'll explain you with more details
1

Offline