Jump to content

BigWolf

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by BigWolf

  1. Having the same issue ShipScriptLoader.lua local Config = {} Config.author = 'Dirtyredz' Config.name = 'Ship Script Loader' Config.homepage = "https://github.com/dirtyredz/AvorionBoilerPlate" Config.version = { major=1, minor=0, patch = 0, string = function() return Config.version.major .. '.' .. Config.version.minor .. '.' .. Config.version.patch end } Config.Scripts = {} function Config.Add(scriptPath) table.insert(Config.Scripts,scriptPath) end -- Example use to add a script to a players ship -- Config.Add("mods/YourMod/scripts/entity/YourMod.lua") Config.Add("mods/CarrierCommander/scripts/entity/CarrierCommander.lua") return Config server.lua package.path = package.path .. ";data/scripts/lib/?.lua" package.path = package.path .. ";data/scripts/server/?.lua" require ("factions") require ("stringutility") function onStartUp() Server():registerCallback("onPlayerLogIn", "onPlayerLogIn") Server():registerCallback("onPlayerLogOff", "onPlayerLogOff") Galaxy():registerCallback("onPlayerCreated", "onPlayerCreated") Galaxy():registerCallback("onFactionCreated", "onFactionCreated") end function onShutDown() end function update(timeStep) local server = Server() local guardianRespawnTime = server:getValue("guardian_respawn_time") if guardianRespawnTime then guardianRespawnTime = guardianRespawnTime - timeStep; if guardianRespawnTime < 0 then guardianRespawnTime = nil end server:setValue("guardian_respawn_time", guardianRespawnTime) end local serverRuntime = server:getValue("online_time") or 0 serverRuntime = serverRuntime + timeStep server:setValue("online_time", serverRuntime) end function onPlayerCreated(index) local player = Player(index) Server():broadcastChatMessage("Server", 0, "Player %s created!"%_t, player.name) end function onFactionCreated(index) end function onPlayerLogIn(playerIndex) local player = Player(playerIndex) Server():broadcastChatMessage("Server", 0, "Player %s joined the galaxy"%_t, player.name) player:addScriptOnce("headhunter.lua") player:addScriptOnce("eventscheduler.lua") player:addScriptOnce("story/spawnswoks.lua") player:addScriptOnce("story/spawnai.lua") player:addScriptOnce("story/spawnguardian.lua") player:addScriptOnce("story/spawnadventurer.lua") player:addScriptOnce("player/asteroidMover.lua") --mOS matchResources(player) end function onPlayerLogOff(playerIndex) local player = Player(playerIndex) Server():broadcastChatMessage("Server", 0, "Player %s left the galaxy"%_t, player.name) end local s, b = pcall(require, 'mods/AvorionBoilerPlate/scripts/server/server') if s then if b.onPlayerLogIn then local a = onPlayerLogIn; onPlayerLogIn = function(c) a(c); b.onPlayerLogIn(c); end end end
×
×
  • Create New...