View difference between Paste ID: kD8k4TYs and JQi7HXJc
SHOW: | | - or go back to the newest paste.
1
fly = false -- false : fly désactivé par défaut, true : fly activé par defaut
2
teleport = false -- false : tpclick désactivé par défaut, true : tpclick activé par defaut.
3
code = "MotDePasse" -- Mot de passe dès l'entrée d'un joueur
4
demandeCode = false -- Demander le code ? true : oui, false : non
5
owner = "PseudoAdmin" -- Pseudo de l'administrateur.
6-
version = "v2.1" -- Ne pas toucher
6+
version = "v2.2" -- Ne pas toucher
7
8
for name in pairs(tfm.get.room.playerList) do 
9
        system.bindMouse(name, true) 
10
end
11
system.disableChatCommandDisplay("aide")
12
system.disableChatCommandDisplay("vampire")
13
system.disableChatCommandDisplay("chamane")
14
system.disableChatCommandDisplay("respawn")
15
system.disableChatCommandDisplay("mort")
16
system.disableChatCommandDisplay("fromage")
17
system.disableChatCommandDisplay("meep")
18
system.disableChatCommandDisplay("lock")
19
system.disableChatCommandDisplay("unlock")
20
system.disableChatCommandDisplay("unlockP")
21
system.disableChatCommandDisplay("tp")
22
system.disableChatCommandDisplay("all-fly")
23
system.disableChatCommandDisplay("all-fly false")
24
system.disableChatCommandDisplay("tpclick")
25
system.disableChatCommandDisplay("tpclick false")
26
system.disableChatCommandDisplay("aideADM")
27
system.disableChatCommandDisplay("time")
28
29
30
print("<font color='#FFFF00'>TribeOS "..version.." started.</font>")
31
print("")
32
print("<font color='#C2C2DA'><font color='#FFFF00'><b>!aideADM</b></font> : Liste des commandes ADMIN !</font>")
33
print("<font color='#C2C2DA'>Faites l'émote <font color='#FFFF00'><b>dormir</b></font>, fonction cachée :D")
34
print("")
35
ui.addPopup(0, 0, "<p align='center'><font size='15'><b>Bienvenue sur TribeOS "..version.." !</b></font></p><br><font size='12'>Les commandes sont disponibles en tapant !aide.<br><br><b><font size='14' face='Consolas'>TribeOS "..version.." - RUN</b></font><br><b><font size='8' face='Comic Sans MS'>Coded by Nathaan</b></font>", playerName, 200, 100, 400)
36
37
ui.addTextArea(0, "<b><font size='14' face='Consolas' color='#000000' >TribeOS "..version.." - RUN</b></font>", all, 0, 20, 800, 20, 0x000000, 0x000000, 0)
38
ui.addTextArea(1, "<b><font size='8' face='Comic Sans MS' color='#000000' >Coded by Nathaan</b></font>", all, 0, 38, 800, 20, 0x000000, 0x000000, 0)
39
40
function eventNewPlayer(playerName)
41
 
42
        for name in pairs(tfm.get.room.playerList) do 
43
                system.bindMouse(name, true) 
44
        end
45
        tfm.exec.bindKeyboard(playerName,32,true,true)
46
        if demandeCode then
47
                ui.addPopup(101, 0, "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>", playerName, -1000, -1000, 1000000)
48
                ui.addPopup(102, 2, "<font size='15'><b>Insérez le code d'accées.</b></font>", playerName, 300, 150, 200)
49
        end
50
        ui.addTextArea(0, "<b><font size='14' face='Consolas' color='#000000' >TribeOS "..version.." - RUN</b></font>", all, 0, 20, 800, 20, 0x000000, 0x000000, 0)
51
        ui.addTextArea(1, "<b><font size='8' face='Comic Sans MS' color='#000000' >Coded by Nathaan</b></font>", all, 0, 38, 800, 20, 0x000000, 0x000000, 0)
52
        ui.addPopup(0, 0, "<p align='center'><font size='15'><b>Bienvenue sur TribeOS "..version.." !</b></font></p><br><font size='12'>Les commandes sont disponibles en tapant !aide.<br><br><b><font size='14' face='Consolas'>TribeOS "..version.." - RUN</b></font><br><b><font size='8' face='Comic Sans MS'>Coded by Nathaan</b></font>", playerName, 200, 100, 400)
53
54
end
55
56
function eventEmotePlayed(playerName, emote)
57
        if emote==6 then
58
                ui.addPopup(111,2,"<p align='center'><font size='30'><b><font face='Time Sans MS'>Special Agents Mices</font></b><br></font><font size='15'>Votre message special",playerName,200,50,400)
59
        end
60
end
61
 
62
function eventPopupAnswer(id, playerName, answer)
63
        if id == 102 then
64
                if answer == code then
65
                        ui.addPopup(101, 0, "<font size='15'><b>Le code est correct.</b></font>", playerName, 300, 150, 200)
66
                else
67
                        ui.addPopup(102, 2, "<font size='15'><b>Insérez le code d'accées.</b></font>", playerName, 300, 150, 200)
68
                end
69
        end
70
71
        if id == 111 then
72
                print("<font color='#009D9D'>["..playerName.."]</font> <font color='#C2C2DA'>"..answer.."</font>")
73
                ui.addPopup(112, 0, "<font color='#009D9D' size='15'>["..playerName.."]</font> <font size='15'>"..answer.."</font>", nil, 0, 24, 800)
74
        end
75
end
76
77
function eventChatCommand(playerName, message)
78
        local arg = {}
79
        for argument in message:gmatch ("[^%s]+") do
80
                table.insert (arg, argument);
81
        end
82
       
83
        if arg[1] == "tp" then
84
                tfm.exec.movePlayer (arg[2], arg[3], arg[4]);
85
        end
86
        if arg[1] == "time" then
87
                tfm.exec.setGameTime(arg[2])
88
        end
89
        if message=="aide" then
90
                ui.addPopup(1, 0, "<p align='center'><font size='16' color='#FF0000'><b>Commandes</b></font></p><br><font size='12' color='#C2C2DA'><font color='#EB1D51'><b>!vampire</b></font> : Se transformer en vampire.<br><font color='#EB1D51'><b>!chamane</b></font> : Devenir un chamane (sans compétences)<br><font color='#EB1D51'><b>!respawn</b></font> : Respawn dans les maps ou des joueurs sont encore présents.<br><font color='#EB1D51'><b>!mort</b></font> : Similaire à la commande /mort.<br><font color='#EB1D51'><b>!fromage</b></font> : Vous donne le fromage.<br><font color='#EB1D51'><b>!meep</b></font> : Vous donne le droit de meep..<br><font color='#EB1D51'><b>!tp [JOUEUR] [X] [Y]</b></font> : Téléporter un joueur aux coordonées demandés.", playerName, 200, 50, 400)
91
        end
92
        if message=="vampire" then
93
                tfm.exec.setVampirePlayer(playerName)
94
        end
95
        if message=="chamane" then
96
                tfm.exec.setShaman(playerName)
97
        end
98
        if message=="respawn" then
99
                tfm.exec.respawnPlayer(playerName)
100
        end
101
        if message=="mort" then
102
                tfm.exec.killPlayer(playerName)
103
        end
104
        if message=="fromage" then
105
                tfm.exec.giveCheese(playerName)
106
        end
107
        if message=="meep" then
108
                tfm.exec.giveMeep(playerName)
109
        end
110
        if playerName == owner then
111
                if message=="unlock" then
112
                        ui.addPopup(101, 0, "<font size='15'><b>Deverouille par un admin.</b></font>", all, 300, 150, 200)
113
                        ui.addPopup(102, 0, "<font size='15'><b>Vous devez fermer cette fenêtre..</b></font>", all, 90, 150, 200)
114
                end
115
                if message=="lock" then
116
                        ui.addPopup(101, 0, "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>", all, -1000, -1000, 1000000)
117
                        ui.addPopup(102, 2, "<font size='15'><b>Insérez le code d'accées.</b></font>", all, 300, 150, 200)
118
                end
119
                if message=="all-fly" then
120
                        fly = true
121
                end
122
                if message=="aideADM" then
123
                        ui.addPopup(1, 0, "<p align='center'><font size='16' color='#FF0000'><b>Commandes admin</b></font></p><br><font size='12' color='#C2C2DA'><font color='#EB1D51'><b>!unlock</b></font> : Dévérouiller pour tout le monde.<br><font color='#EB1D51'><b>!unlockP [PlayerName]</b></font> : Dévérouiller pour un joueur précis.<br><font color='#EB1D51'><b>!lock</b></font> : Bloquer à tout le monde.<br><font color='#EB1D51'><b>!all-fly (false)</b></font> : Donner l'autorisation à tout le monde de voler (false pour désactiver)<br><font color='#EB1D51'><b>!tpclick (false)</b></font> : Donne l'autorisation à tout le monde de se téléporter en cliquant. (false pour désactiver)", playerName, 200, 50, 400)
124
                end
125
                if message=="all-fly false" then
126
                        fly = false
127
                end
128
                local UP = {}
129
                for argument in message:gmatch ("[^%s]+") do
130
                        table.insert (UP, argument);
131
                end
132
       
133
                if UP[1] == "unlockP" then
134
                        ui.addPopup(101, 0, "<font size='15'><b>Deverouille par un admin.</b></font>", UP[2], 300, 150, 200)
135
                        ui.addPopup(102, 0, "<font size='15'><b>Vous devez fermer cette fenêtre..</b></font>", UP[2], 90, 150, 200)
136
                end
137
                        if message=="tpclick" then
138
                        teleport = true
139
                end
140
                if message=="tpclick false" then
141
                        teleport = false
142
                end
143
        end                 
144
end
145
146
for playerName,player in pairs(tfm.get.room.playerList) do
147
        eventNewPlayer(playerName)
148
end
149
 
150
function eventKeyboard(playerName,key,down,x,y)
151
        if fly then
152
                if key==32 then
153
                        tfm.exec.movePlayer(playerName,0,0,true,0,-50,false)
154
                end
155
        end
156
end
157
158
function eventMouse(playerName, x, y) 
159
         if teleport then
160
                  tfm.exec.movePlayer(playerName,x,y)
161
         end
162
end