Created
November 14, 2022 02:42
-
-
Save 1-creare-1/e2d1111c2a4ef8f50a13c69b1bd853b2 to your computer and use it in GitHub Desktop.
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 switch = GetPartFromPort(1, "Switch") | |
local gyro = GetPartFromPort(1, "Gyro") | |
local mic = GetPartFromPort(1, "Microphone") | |
local on = false | |
switch:Configure({SwitchValue = false}) | |
mic:Connect("Chatted", function (Player, Message) | |
print(Player) | |
if Player ~= "Makerbenjammin6" then return end | |
local split = Message:split(" ") | |
local command = split[1]:lower() | |
if command == "target" then | |
gyro:Configure({Seek = split[2]}) | |
elseif command == "radar" then | |
gyro:Configure({Seek = "Radar " .. split[2]}) | |
elseif command == "alien" then | |
gyro:Configure({Seek = "Radar AlienCore"}) | |
elseif command == "toggle" then | |
if not split[2] then | |
switch:Configure({SwitchValue = not on}) | |
on = not on | |
return | |
end | |
if split[2]:lower() == "true" then | |
switch:Configure({SwitchValue = true}) | |
elseif split[2]:lower() == "false" then | |
switch:Configure({SwitchValue = false}) | |
else | |
switch:Configure({SwitchValue = not on}) | |
on = not on | |
end | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment