-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstartFuncs.lua
44 lines (38 loc) · 1.3 KB
/
startFuncs.lua
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
32
33
34
35
36
37
38
39
40
41
42
43
44
--[[
name: startFuncs.lua
description: Contains code that must be executed at start.
]]--
do
local _, msg = pcall(nil)
local img = tfm.exec.addImage("a.jpg", "_0", 1, 1)
local pdata = system.loadPlayerData("")
tfm.get.room.loader = string.match(msg, "^(.-)%.")
tfm.get.room.elevation = img and (pdata and "module" or "funcorp") or "player"
end
if tfm.get.room.elevation == "player" then
addImage = function() end
removeImage = function() end
chatMessage = function() end
end
print("loader: " .. tfm.get.room.loader)
print("elevation: " .. tfm.get.room.elevation)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoScore(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.setAutoMapFlipMode(randomFlip())
tfm.exec.newGame(randomMap(stMapsLeft, stMapCodes))
tfm.exec.disablePhysicalConsumables(true)
tfm.exec.setGameTime(MAPTIME, true)
tfm.exec.setRoomMaxPlayers(26)
tfm.exec.disablePrespawnPreview(true)
tfm.exec.disableAllShamanSkills(true)
if string.find(room.name, "^[a-z][a-z2]%-#ninja%d+editor%d*$") or string.find(room.name, "^%*#ninja%d+editor%d*$") then
customRoom = true
end
-- INIT ALL EXISTING PLAYERS
for playerName in pairs(room.playerList) do
inRoom[playerName] = true
initPlayer(playerName)
end