Created
February 17, 2021 05:19
-
-
Save x4fx77x4f/96d2fc914987fee5fd4f49dc750a57ec to your computer and use it in GitHub Desktop.
Starfall helper; proof of concept of using Expression 2 to bring extra functionality to Starfall
This file contains hidden or 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
wire.adjustOutputs({"SFH_Clk", "SFH_Entity1", "SFH_Number1"}, {"number", "entity", "number"}) | |
local ports = wire.ports | |
local Player = getMethods("Player") | |
function Player:setHealth(amount) | |
ports.SFH_Entity1 = self | |
ports.SFH_Number1 = amount | |
ports.SFH_Clk = 1 | |
ports.SFH_Clk = 0 | |
end | |
function Player:spawn() | |
ports.SFH_Entity1 = self | |
ports.SFH_Clk = 2 | |
ports.SFH_Clk = 0 | |
end | |
function Player:setGodMode(bool) | |
ports.SFH_Entity1 = self | |
ports.SFH_Number1 = bool and 1 or 0 | |
ports.SFH_Clk = 3 | |
ports.SFH_Clk = 0 | |
end | |
function Player:setNoclipped(bool) | |
ports.SFH_Entity1 = self | |
ports.SFH_Number1 = bool and 1 or 0 | |
ports.SFH_Clk = 4 | |
ports.SFH_Clk = 0 | |
end | |
function Player:setAlpha(amount) | |
ports.SFH_Entity1 = self | |
ports.SFH_Number1 = amount | |
ports.SFH_Clk = 5 | |
ports.SFH_Clk = 0 | |
end | |
function Player:setNoclipEnabled(bool) | |
ports.SFH_Entity1 = self | |
ports.SFH_Number1 = bool and 0 or 1 | |
ports.SFH_Clk = 6 | |
ports.SFH_Clk = 0 | |
end |
This file contains hidden or 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
@name Starfall sucks | |
@inputs Clk:number Entity1:entity Number1:number | |
@trigger Clk | |
if (Clk & !first()) { | |
switch (Clk) { | |
case 1, | |
Entity1:plySetHealth(Number1) | |
break | |
case 2, | |
Entity1:plySpawn() | |
break | |
case 3, | |
Entity1:plyGod(Number1) | |
break | |
case 4, | |
Entity1:plyNoclip(Number1) | |
break | |
case 5, | |
Entity1:plyAlpha(Number1) | |
break | |
case 6, | |
Entity1:plyDisableNoclip(Number1) | |
break | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment