PDA

View Full Version : If (anyone) on screen say "please leave" [simple request]



Tobix123
07-29-2016, 02:58 PM
Hello!

How to write scriptando like in title?

Self.GetSpectators(), returns table, no players amount(?) to do if Self.G.Spec() > 0 then say "p. leave"...

thanks :)

Zingron
07-29-2016, 04:28 PM
playerTable = {}

Module.New('checkPlayersOnScreen', function(messagePlayer)
if not(Self.isInPz()) then
for name, obj in Creature.iPlayers(6) do
if table.contains(playerTable, name) then
Self.Say("please leave")
wait(10000,15000)
else
table.insert(playerTable, name)
Self.Say("Hello???")
wait(10000,15000)
end
end
end
messagePlayer:Delay(2000)
end)



Edit: added the pz checker so it won't say it in dp

Tobix123
07-30-2016, 01:07 AM
playerTable = {}

Module.New('checkPlayersOnScreen', function(messagePlayer)
for name, obj in Creature.iPlayers(6) do
if table.contains(playerTable, name) then
Self.Say("please leave")
wait(10000,15000)
else
table.insert(playerTable, name)
Self.Say("Hello???")
wait(10000,15000)
end
end
messagePlayer:Delay(2000)
end)




thanks bro, ill check it later :)

derkonsito
07-30-2016, 04:51 AM
@Tobix123 The only problem with that bro is that your bot will say leave please in depot!!
Tobix123