Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ ### Ghostly! v1 ###]]--
- --[[ ### Alternating Camouflage ###]]--
- --[[ ### by H® Shaft for Phasor v2 ###]]--
- -- Based on the settings per map, (ffa_invis and team_invis), players or teams will alternate appearing and disappearing in 5 second loops
- -- When applied in FFA, players will be invisible for 5 seconds, then will be visible for 5 seconds
- -- When applied in TEAM, red players will be invisible for 5 seconds, while blue will be visible for 5 seconds, then vice-versa
- -- Best for small maps or open maps
- team_play = false
- game_started = false
- ffa_invis = {}
- team_invis = {}
- cur_players = 0
- -- ffa alternating camo
- ffa_invis. beavercreek = true -- battle creek
- ffa_invis. bloodgulch = false
- ffa_invis. boardingaction = true
- ffa_invis. carousel = true -- derelict
- ffa_invis. chillout = true
- ffa_invis. damnation = true
- ffa_invis. dangercanyon = false
- ffa_invis. deathisland = false
- ffa_invis. gephyrophobia = false
- ffa_invis. hangemhigh = true
- ffa_invis. icefields = false
- ffa_invis. infinity = false
- ffa_invis. longest = true
- ffa_invis. prisoner = true
- ffa_invis. putput = true -- chiron tl34
- ffa_invis. ratrace = true
- ffa_invis. sidewinder = false
- ffa_invis. timberland = false
- ffa_invis. wizard = true
- ffa_invis. ballbeavercreek = true
- ffa_invis. ballcarousel = true
- ffa_invis. ballchillout = true
- ffa_invis. balldamnation = true
- ffa_invis. ballhangemhigh = true
- ffa_invis. balllongest = true
- ffa_invis. ballprisoner = true
- ffa_invis. ballputput = true
- ffa_invis. ballratrace = true
- ffa_invis. ballwizard = true
- ffa_invis. ballbloodgulch = false
- ffa_invis. ballsidewinder = false
- -- team alternating camo
- team_invis. beavercreek = true -- battle creek
- team_invis. bloodgulch = false
- team_invis. boardingaction = true
- team_invis. carousel = true -- derelict
- team_invis. chillout = true
- team_invis. damnation = true
- team_invis. dangercanyon = false
- team_invis. deathisland = false
- team_invis. gephyrophobia = false
- team_invis. hangemhigh = true
- team_invis. icefields = false
- team_invis. infinity = false
- team_invis. longest = true
- team_invis. prisoner = true
- team_invis. putput = true -- chiron tl34
- team_invis. ratrace = true
- team_invis. sidewinder = false
- team_invis. timberland = false
- team_invis. wizard = true
- team_invis. ballbeavercreek = true
- team_invis. ballcarousel = true
- team_invis. ballchillout = true
- team_invis. balldamnation = true
- team_invis. ballhangemhigh = true
- team_invis. balllongest = true
- team_invis. ballprisoner = true
- team_invis. ballputput = true
- team_invis. ballratrace = true
- team_invis. ballwizard = true
- team_invis. ballbloodgulch = true
- team_invis. ballsidewinder = true
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(process, game, persistent)
- if game == true or game == "PC" then
- GAME = "PC"
- gametype_base = 0x671340
- map_name = readstring(0x698F21)
- else
- GAME = "CE"
- gametype_base = 0x5F5498
- map_name = readstring(0x61D151)
- end
- if getteamplay() == true then team_play = true else team_play = false end
- for i=0,15 do
- if getplayer(i) then
- cur_players = cur_players + 1
- end
- end
- if game_started == false and cur_players > 0 then game_started = true end
- end
- function OnNewGame(map)
- if GAME == "PC" then
- gametype_base = 0x671340
- map_name = readstring(0x698F21)
- elseif GAME == "CE" then
- gametype_base = 0x5F5498
- map_name = readstring(0x61D151)
- end
- game_started = true
- if getteamplay() == true then team_play = true else team_play = false end
- for i=0,15 do
- if getplayer(i) then
- cur_players = cur_players + 1
- end
- end
- if team_play and game_started then
- if team_invis[map_name] then
- teaminvis = registertimer(500, "red_team_invis_start")
- end
- elseif not team_play and game_started then
- if ffa_invis[map_name] then
- ffainvis = registertimer(500, "ffa_invis_start")
- end
- end
- end
- function getteamplay()
- if readbyte(gametype_base + 0x34) == 1 then
- return true
- else
- return false
- end
- end
- function OnPlayerJoin(player)
- if getplayer(player) then
- cur_players = cur_players + 1
- if team_play then
- if team_invis[map_name] then
- privatesay(player, "Ghostly Teams!")
- privatesay(player, "Teams will Alternate Appearing and Disappearing")
- end
- elseif not team_play then
- if ffa_invis[map_name] then
- privatesay(player, "Ghostly Free for All!")
- privatesay(player, "Players will Alternate Appearing and Disappearing")
- end
- end
- end
- end
- function OnPlayerLeave(player)
- if getplayer(player) then
- cur_players = cur_players - 1
- end
- end
- function OnGameEnd(stage)
- if stage == 1 then
- game_started = false
- if teaminvis then
- removetimer(teaminvis)
- teaminvis = nil
- end
- if ffainvis then
- removetimer(ffainvis)
- ffainvis = nil
- end
- if blue_team_invis then
- removetimer(blue_team_invis)
- blue_team_invis = nil
- end
- if red_team_invis then
- removetimer(red_team_invis)
- red_team_invis = nil
- end
- if ffa_invisi then
- removetimer(ffa_invisi)
- ffa_invisi = nil
- end
- if ffa_uninvis then
- removetimer(ffa_uninvis)
- ffa_uninvis = nil
- end
- end
- end
- function red_team_invis_start(id, count) -- alternating invisible teams begin loop
- if count == 1 then
- for x = 0,15 do
- if getplayer(x) then
- local team = getteam(x)
- if team == 0 then
- applycamo(x, 5)
- end
- end
- end
- blue_team_invis = registertimer(6000, "Blue_Team_Invis") -- initiates first loop
- end
- return true
- end
- function ffa_invis_start(id, count)
- if count == 1 then
- for x = 0,15 do
- if getplayer(x) then
- applycamo(x, 5)
- end
- end
- ffa_uninvis = registertimer(6000, "Ffa_Uninvis") -- initiates first loop
- end
- return true
- end
- -- univis note: used to slightly adjust players camo time for joining/spawning players (player latency)
- function Ffa_Uninvis(id, count)
- for x = 0,15 do
- if getplayer(x) then
- applycamo(x, 1)
- end
- end
- ffa_invisi = registertimer(6000, "Ffa_Invisi")
- return false
- end
- function Ffa_Invisi(id, count)
- for x = 0,15 do
- if getplayer(x) then
- applycamo(x, 5)
- end
- end
- ffa_uninvis = registertimer(6000, "Ffa_Uninvis") -- initiates timer for ffa loopback
- return false
- end
- function Red_Team_Invis(id, count)
- for x = 0,15 do
- if getplayer(x) then
- local team = getteam(x)
- if team == 0 then
- applycamo(x, 5)
- end
- end
- end
- blue_team_invis = registertimer(6000, "Blue_Team_Invis") -- initiates timer for blue loopback
- return false
- end
- function Blue_Team_Invis(id, count)
- for x = 0,15 do
- if getplayer(x) then
- local team = getteam(x)
- if team == 1 then
- applycamo(x, 5)
- end
- end
- end
- red_team_invis = registertimer(6000, "Red_Team_Invis") -- initiates timer for red loopback
- return false
- end
- -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
- -- Visit http://halorace.org/forum/index.php?topic=514.0 or
- -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment