all of the inputs are in starterplayerscripts, this is that script: local UIS = game:GetService("UserInputService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local hrp = char:WaitForChild("HumanoidRootPart")
local animator = humanoid:WaitForChild("Animator")
local animationsFolder = ReplicatedStorage:WaitForChild("GlacierAnimations")
local remoteEvent = ReplicatedStorage:WaitForChild("GlacierHitEvent")
local m1Anims = {
animationsFolder:WaitForChild("M1_1"),
animationsFolder:WaitForChild("M1_2"),
animationsFolder:WaitForChild("M1_3"),
animationsFolder:WaitForChild("M1_4")
}
local m2Anim = animationsFolder:WaitForChild("M2_Heavy")
local combo = 1
local isAttacking = false
local comboCooldown = false
local originalWalkSpeed = humanoid.WalkSpeed
local slowWalkSpeed = 4
local slowTimer = 0
local airCombatActive = false
local airHitsDone = 0
local maxAirHits = 3
local m2Cooldown = false
local function slowPlayer(duration)
slowTimer = tick() + duration
humanoid.WalkSpeed = slowWalkSpeed
end
RunService.Heartbeat:Connect(function()
if slowTimer > 0 and tick() > slowTimer then
humanoid.WalkSpeed = originalWalkSpeed
slowTimer = 0
end
end)
local function isInAir()
local state = humanoid:GetState()
return state == Enum.HumanoidStateType.Freefall
or state == Enum.HumanoidStateType.Jumping
or hrp.Velocity.Y > 1
end
humanoid.StateChanged:Connect(function(old, new)
if new == Enum.HumanoidStateType.Landed then
airCombatActive = false
airHitsDone = 0
print("Landed: air combat reset")
end
end)
local function canAttack()
if isAttacking or comboCooldown then
return false
end
if isInAir() then
if not airCombatActive then
return false
end
if airHitsDone >= maxAirHits then
return false
end
end
return true
end
local function playM1()
if not canAttack() then return end
isAttacking = true
local anim = animator:LoadAnimation(m1Anims[combo])
anim:Play()
local air = isInAir()
remoteEvent:FireServer(5, 6, air)
slowPlayer(0.4)
task.delay(anim.Length, function()
isAttacking = false
if air then
airHitsDone += 1
end
if combo == 4 then
comboCooldown = true
task.delay(1.5, function()
comboCooldown = false
end)
combo = 1
else
combo += 1
end
end)
end
local function playM2()
if isAttacking or m2Cooldown then return end
isAttacking = true
m2Cooldown = true
local anim = animator:LoadAnimation(m2Anim)
anim:Play()
local air = isInAir()
print("M2 pressed. In air:", air)
remoteEvent:FireServer(6, 12, air)
slowPlayer(0.6)
if air and not airCombatActive then
airCombatActive = true
print("Air combat activated!")
end
task.delay(anim.Length, function()
isAttacking = false
end)
task.delay(4, function()
m2Cooldown = false
end)