View difference between Paste ID: 4kq8BpTa and d075Qt65
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 = "v3.2" -- Ne pas toucher
7-
version = "v3.0" -- 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
system.disableChatCommandDisplay("couleur")
29
system.disableChatCommandDisplay("spawnobject")
30
system.disableChatCommandDisplay("spawnobjectP")
31
system.disableChatCommandDisplay("lockP")
32
system.disableChatCommandDisplay("couleurP")
33
34
35
print("<font color='#FFFF00'>TribeOS "..version.." started.</font>")
36
print("")
37
print("<font color='#C2C2DA'><font color='#FFFF00'><b>!aideADM</b></font> : Liste des commandes ADMIN !</font>")
38
print("<font color='#C2C2DA'>Faites l'émote <font color='#FFFF00'><b>dormir</b></font>, fonction cachée :D")
39
print("")
40
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)
41
42
ui.addTextArea(0, "<b><font size='14' face='Consolas' color='#000000' >TribeOS "..version.." - RUN</b></font>", all, 0, 20, 800, 20, 0x000000, 0x000000, 0)
43
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)
44
45
46
function eventNewPlayer(playerName)
47
 
48
        if playerName == owner then
49
                tfm.exec.setNameColor(playerName, 0x0FFFFF)
50
        end
51
        for name in pairs(tfm.get.room.playerList) do 
52
                system.bindMouse(name, true) 
53
        end
54
        tfm.exec.bindKeyboard(playerName,32,true,true)
55
        if demandeCode then
56
                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)
57
                ui.addPopup(102, 2, "<font size='15'><b>Insérez le code d'accées.</b></font>", playerName, 300, 150, 200)
58
        end
59
        ui.addTextArea(0, "<b><font size='14' face='Consolas' color='#000000' >TribeOS "..version.." - RUN</b></font>", all, 0, 20, 800, 20, 0x000000, 0x000000, 0)
60
        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)
61
        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)
62
63
end
64
65
function eventEmotePlayed(playerName, emote)
66
        if emote==6 then
67
                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)
68
        end
69
end
70
 
71
function eventPopupAnswer(id, playerName, answer)
72
        if id == 102 then
73
                if answer == code then
74
                        ui.addPopup(101, 0, "<font size='15'><b>Le code est correct.</b></font>", playerName, 300, 150, 200)
75
                else
76
                        ui.addPopup(102, 2, "<font size='15'><b>Insérez le code d'accées.</b></font>", playerName, 300, 150, 200)
77
                end
78
        end
79
80
        if id == 111 then
81
                print("<font color='#009D9D'>["..playerName.."]</font> <font color='#C2C2DA'>"..answer.."</font>")
82
                ui.addPopup(112, 0, "<font color='#009D9D' size='15'>["..playerName.."]</font> <font size='15'>"..answer.."</font>", nil, 0, 24, 800)
83
        end
84
end
85
86
function eventChatCommand(playerName, message)
87
        local arg = {}
88
        for argument in message:gmatch ("[^%s]+") do
89
                table.insert (arg, argument);
90
        end
91
        if arg[1] == "tp" then
92
                tfm.exec.movePlayer(arg[2], arg[3], arg[4])
93
        end
94
        if arg[1] == "time" then
95
                tfm.exec.setGameTime(arg[2])
96
        end
97
        if arg[1] == "spawnobject" then
98
                tfm.exec.addShamanObject(arg[2],tfm.get.room.playerList[playerName].x,tfm.get.room.playerList[playerName].y)
99
        end
100-
                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.<br><font color='#EB1D51'><b>!couleur ABCDEF</b></font> : Choisir la couleur de son pseudo, NE PAS METTRE LE # !<br><font color='#EB1D51'><b>!spawnobject</b></font> : Faire apparaître l'objet voulu à coté de soi. Marquez l'ID de l'objet.", playerName, 200, 50, 400)
100+
        if arg[1] == "spawnobjectP" then
101
                tfm.exec.addShamanObject(arg[2],arg[3],arg[4])
102
        end
103
        if arg[1] == "couleur" then
104
               tfm.exec.setNameColor(playerName, "0x"..arg[2])
105
        end
106
        if message=="aide" then
107
                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.<br><font color='#EB1D51'><b>!couleur ABCDEF</b></font> : Choisir la couleur de son pseudo, NE PAS METTRE LE # !<br><font color='#EB1D51'><b>!spawnobject [ID]</b></font> : Faire apparaître l'objet voulu à coté de soi.<br><font color='#EB1D51'><b>!spawnobjectP [ID] [X] [Y]</b></font> : Faire apparaître l'objet voulu au coordonées X et Y.", playerName, 200, 50, 400)
108
        end
109
        if message=="vampire" then
110
                tfm.exec.setVampirePlayer(playerName)
111
        end
112
        if message=="chamane" then
113
                tfm.exec.setShaman(playerName)
114
        end
115
        if message=="respawn" then
116
                tfm.exec.respawnPlayer(playerName)
117
        end
118
        if message=="mort" then
119
                tfm.exec.killPlayer(playerName)
120
        end
121
        if message=="fromage" then
122
                tfm.exec.giveCheese(playerName)
123
        end
124
        if message=="meep" then
125
                tfm.exec.giveMeep(playerName)
126
        end
127
        if playerName == owner then
128
                if message=="unlock" then
129
                        ui.addPopup(101, 0, "<font size='15'><b>Deverouille par un admin.</b></font>", all, 300, 150, 200)
130
                        ui.addPopup(102, 0, "<font size='15'><b>Vous devez fermer cette fenêtre..</b></font>", all, 90, 150, 200)
131
                end
132
                if message=="lock" then
133
                        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)
134
                        ui.addPopup(102, 2, "<font size='15'><b>Insérez le code d'accées.</b></font>", all, 300, 150, 200)
135
                end
136
                if message=="all-fly" then
137
                        fly = true
138
                end
139
                if message=="aideADM" then
140
                        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>!lockP</b></font> : Bloquer pour un joueur précis.<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)<br><font color='#EB1D51'><b>!couleurP [PSEUDO] [COULEUR SANS LE #]</b></font> : Mettre le pseudo de quelqu'un en couleur.", playerName, 200, 50, 400)
141
                end
142
                if message=="all-fly false" then
143
                        fly = false
144
                end
145
                local UP = {}
146
                for argument in message:gmatch ("[^%s]+") do
147
                        table.insert (UP, argument);
148
                end
149
       
150
                if UP[1] == "unlockP" then
151
                        ui.addPopup(101, 0, "<font size='15'><b>Deverouille par un admin.</b></font>", UP[2], 300, 150, 200)
152
                        ui.addPopup(102, 0, "<font size='15'><b>Vous devez fermer cette fenêtre..</b></font>", UP[2], 90, 150, 200)
153-
                        if message=="tpclick" then
153+
154
                if UP[1] == "couleurP" then
155
                        tfm.exec.setNameColor(arg[2], "0x"..arg[3])
156
                end
157
                if UP[1] == "lockP" then
158
                        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>", arg[2], -1000, -1000, 1000000)
159-
                end                 
159+
160
                end
161
                if message=="tpclick" then
162
                        teleport = true
163
                end
164
                if message=="tpclick false" then
165
                        teleport = false
166
                end          
167
        end
168
end
169
170
for playerName,player in pairs(tfm.get.room.playerList) do
171
        eventNewPlayer(playerName)
172
end
173
 
174
function eventKeyboard(playerName,key,down,x,y)
175
        if fly then
176
                if key==32 then
177
                        tfm.exec.movePlayer(playerName,0,0,true,0,-50,false)
178
                end
179
        end
180
end
181
182
function eventMouse(playerName, x, y) 
183
         if teleport then
184
                  tfm.exec.movePlayer(playerName,x,y)
185
         end
186
end