Skip to content

Commit

Permalink
Merge commit '18e4c4d5048dc3484d710801622a3ffcb06cd83a'
Browse files Browse the repository at this point in the history
  • Loading branch information
standardcombo committed Mar 14, 2021
2 parents d566a21 + 18e4c4d commit cf737ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
15 changes: 10 additions & 5 deletions Strike Team/Data/Scripts/Player Movement.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function OnBindingPressed(player, key)
return
end
if key == "ability_feet" then -- Shift
player.serverUserData.playerStatus["ShiftDown"] = true
--player.serverUserData.playerStatus["ShiftDown"] = true
UpdatePlayerSprinting(player)
elseif key == "ability_primary" then -- Left Click
player.serverUserData.playerStatus["LMBDown"] = true
Expand All @@ -84,7 +84,7 @@ function OnBindingReleased(player, key)
return
end
if key == "ability_feet" then -- Shift
player.serverUserData.playerStatus["ShiftDown"] = false
--player.serverUserData.playerStatus["ShiftDown"] = false
UpdatePlayerSprinting(player)
elseif key == "ability_primary" then -- Left Click
player.serverUserData.playerStatus["LMBDown"] = false
Expand All @@ -95,12 +95,16 @@ function OnBindingReleased(player, key)
end
end

function IsShiftDown(player)
return player:IsBindingPressed("ability_feet")
end

function UpdatePlayerSprinting(player)
if _G["MovementCanControl"] == false then
return
end

if player.serverUserData.playerStatus["ShiftDown"] then
if IsShiftDown(player) then
if not player.serverUserData.playerStatus["Aiming"] and not player.serverUserData.playerStatus["Sliding"] then
player.serverUserData.playerStatus["Sprinting"] = true
player.maxWalkSpeed = AddSprintBoost(player)
Expand Down Expand Up @@ -249,8 +253,9 @@ function OnEquipWeapon(owner, weapon)
playerStances[owner]["Sprinting"] = sprintingStance or "2hand_rifle_stance"
playerStances[owner]["Aiming"] = aimingStance or "2hand_rifle_aim_shoulder"

Task.Wait()
if not Object.IsValid(owner) then
Task.Wait(0.11)
if not Object.IsValid(owner) or not Object.IsValid(weapon)
or weapon ~= owner.serverUserData.EquippedWeapon then
return
end

Expand Down
3 changes: 3 additions & 0 deletions Strike Team/Data/Scripts/PlayerMovementChanges.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

warning("DEPRECATED?")

local RUN_SPEED = script:GetCustomProperty("RunSpeed")
local SPRINT_SPEED = script:GetCustomProperty("SprintSpeed")
local SCOPE_SPEED = script:GetCustomProperty("ScopeSpeed")
Expand Down
5 changes: 3 additions & 2 deletions Strike Team/Data/Scripts/StrikeTeamLeaderboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,14 @@ function GenerateLeaderboard()
if localPlayerIndex < 0 and rowsAdded == ROW_COUNT - 1 then
-- Case where player is at the bottom
-- Separator elipsis row at the bottom, before player
entryRank.text = ""
entryName.text = ". . ."
entryName:SetColor(NAME_COLOR_OTHER)
entryValue.text = ""
else
-- Rank
if rankNumber < 0 then
entryRank.text = tostring(#leaderboardData + 1) .. "+"
entryRank.text = tostring(#leaderboardData) .. "+"
else
entryRank.text = tostring(i) .. "."
end
Expand All @@ -175,7 +176,7 @@ function GenerateLeaderboard()
-- Score
local score = averageScores[entry]
if RESOURCE_TO_TRACK == "Objective" then
entryValue.text = string.format("%0.2f", math.ceil(score / 5))
entryValue.text = string.format("%0.2f", score / 5)
else
entryValue.text = string.format("%0.2f", score)
end
Expand Down

0 comments on commit cf737ed

Please sign in to comment.