Skip to content

Commit

Permalink
:freecam now has a controller keybind (DPadLeft) (#1531)
Browse files Browse the repository at this point in the history
* Add new :freecam console keybinds to instructions

* Add DPadLeft as a keybind to toggle freecam

* Add DPadLeft as a keybind to toggle freecam (oops committed too early)
  • Loading branch information
sqikerz authored May 17, 2024
1 parent 37419c0 commit 00339ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions MainModule/Server/Commands/Moderators.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6858,7 +6858,7 @@ return function(Vargs, env)
Prefix = Settings.Prefix;
Commands = {"freecam"};
Args = {"player"};
Description = "Makes it so the target player(s)'s cam can move around freely (Press Space or Shift+P to toggle freecam)";
Description = "Makes it so the target player(s)'s cam can move around freely (Press Shift+P, F, or DPadLeft to toggle freecam)";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
Expand All @@ -6873,7 +6873,7 @@ return function(Vargs, env)
freecam.ResetOnSpawn = false
freecam.Freecam.Disabled = false
freecam.Parent = plrgui
Functions.Notification("Notification", "Freecam has been enabled. Press Shift+P, or F to toggle freecam on or off.", {v}, 15)
Functions.Notification("Notification", "Freecam has been enabled. Press Shift+P, F, or DPadLeft to toggle freecam on or off.", {v}, 15)
end
end
};
Expand Down
4 changes: 3 additions & 1 deletion MainModule/Server/Dependencies/Assets/Freecam.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ do
CheckMacro(FREECAM_MACRO_KB)
end

if input.KeyCode == Enum.KeyCode.F then
if input.KeyCode == Enum.KeyCode.F or input.KeyCode == Enum.KeyCode.DPadLeft then
ToggleFreecam()
end
end
Expand All @@ -501,6 +501,7 @@ do

ContextActionService:BindActionAtPriority("FreecamToggle", HandleActivationInput, false, TOGGLE_INPUT_PRIORITY, FREECAM_MACRO_KB[#FREECAM_MACRO_KB])
ContextActionService:BindActionAtPriority("FreecamToggle2", HandleActivationInput, false, TOGGLE_INPUT_PRIORITY, Enum.KeyCode.F)
ContextActionService:BindActionAtPriority("FreecamToggleDPAD", HandleActivationInput, false, TOGGLE_INPUT_PRIORITY, Enum.KeyCode.DPadLeft)

RF.OnClientInvoke = function(a, b, c)
if a == "Disable" and enabled then
Expand All @@ -522,6 +523,7 @@ do
Debris:AddItem(RF, 0.5)
ContextActionService:UnbindAction("FreecamToggle")
ContextActionService:UnbindAction("FreecamToggle2")
ContextActionService:UnbindAction("FreecamToggleDPAD")
StopFreecam()
end
end
Expand Down

0 comments on commit 00339ab

Please sign in to comment.