Created
November 3, 2012 18:45
-
-
Save Brianetta/4008245 to your computer and use it in GitHub Desktop.
New UI cheat menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ui = Engine.ui | |
local CheatList = ui:VBox() | |
local cheatMission = function (loaded) | |
local cheats = { | |
{'Add cash', function () Game.player:AddMoney(100000) end}, | |
{'Refuel (prop tank)', function () Game.player:SetFuelPercent() end}, | |
{'Refuel (1t H)', function () Game.player:AddEquip('HYDROGEN') end}, | |
{'Refuel (1t Mil)', function () Game.player:AddEquip('MILITARY_FUEL') end}, | |
{'Repair hull', function () Game.player:SetHullPercent() end}, | |
{'Fit autopilot', function () Game.player:AddEquip('AUTOPILOT') end}, | |
{'Fit atmospheric shield', function () Game.player:AddEquip('ATMOSPHERIC_SHIELDING') end}, | |
{'Destroy combat target', function () if Game.player:GetCombatTarget() then Game.player:GetCombatTarget():Explode() end end}, | |
} | |
for key,cheat in pairs(cheats) do | |
local cheatButton = ui:Button():SetInnerWidget(ui:Label(cheat[1])) | |
cheatButton.onClick:Connect(cheat[2]) | |
CheatList:PackEnd(cheatButton) | |
end | |
local missionData = { | |
type = 'cheats', | |
client = Character.New({name = 'Alpha Tester'}), | |
} | |
if Game.time < 5 then Timer:CallAt(5,function () Mission.New(missionData) end) end | |
end | |
Mission.RegisterType('cheats','Cheats!', function () return CheatList end) | |
Event.Register("onGameStart", cheatMission) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment