Animations in a script don't work on one game, but copy and pasting it into a different game works just fine?

So I’m making a platformer game, since I’ve never dipped into stuff like that I just took a free model that works very well. Anyways, The script and the other stuff required is in the game and where they are supposed to be, Some animations work and some don’t. I tried copying and pasting it into another game under the same group and it works perfectly. Don’t know why.

1 Like

Is the platformer game created in a group? If so are all of the other games you’ve created under that group? I’m pretty sure if an animation is created by a group, it only works in games created in the group.

It is under a group, all animations are under the group and both games have the same animations.

Are both games under the same group?

Both of them are under the same group.

Then the animation probably has something to do with the script, can I see the scripts please?

its multiple scripts and they are all giant. Is that fine?

Yeah, that’s fine with me. If parts of the script don’t have to do with the animation you can edit that out if you want, but you don’t have to.

plr = game.Players.LocalPlayer
repeat wait() until workspace[plr.Name] ~= nil
char = script.Parent

--// Module scripts!
States = require(script:WaitForChild("States"))
Effects = require(script:WaitForChild("Effects"))
Sounds = require(script:WaitForChild("Sounds"))

-- // Loading Animations
repeat wait() until char:WaitForChild("Humanoid") ~= nil
hum = char.Humanoid
cam = workspace.CurrentCamera

hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false) -- This is to prevent flings.
hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
hum:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
char.Humanoid.MaxSlopeAngle = 50
isR15 = false
if hum.RigType == Enum.HumanoidRigType.R6 then
	-- Load all of the R6 animations.
    isR15 = false
    local AnimationsFolderR6 = script.Animations.R6
	LongJumpAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.Longjump)
	GroundPoundAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.GroundPound)
	GroundPoundStartA = char.Humanoid:LoadAnimation(AnimationsFolderR6.GroundPoundS)
	WallJumpAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.WallJSlide)
	CrouchAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.Crouch)
	DoubleJumpAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.DoubleJump)
	TripleJumpAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.TripleJump)
	DiveAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.Dive)
	DiveSAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.DiveS)
	WalkAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.Run)
	IdleAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.Idle)
	FallAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.Fall)
	Jump1Anim = char.Humanoid:LoadAnimation(AnimationsFolderR6.Jump1)
	Jump2Anim = char.Humanoid:LoadAnimation(AnimationsFolderR6.Jump2)
	BackflipAnim = char.Humanoid:LoadAnimation(AnimationsFolderR6.Backflip)
else
	-- Load all the R15 animations.
	local AnimationsFolderR15 = script.Animations.R15
	GroundPoundAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.GroundPound)
	GroundPoundStartA = char.Humanoid:LoadAnimation(AnimationsFolderR15.GroundPoundS)
	WalkAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.Run)
	IdleAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.Idle)
	FallAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.Fall)
	Jump1Anim = char.Humanoid:LoadAnimation(AnimationsFolderR15.Jump1)
	Jump2Anim = char.Humanoid:LoadAnimation(AnimationsFolderR15.Jump2)
	DoubleJumpAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.DoubleJump)
	TripleJumpAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.TripleJump)
	DiveAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.Dive)
	DiveSAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.DiveS)
	LongJumpAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.Longjump)
	CrouchAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.Crouch)
	BackflipAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.Backflip)
	WallJumpAnim = char.Humanoid:LoadAnimation(AnimationsFolderR15.WallJSlide)
    isR15 = true
end

for i,v in pairs(workspace.CurrentCamera:GetChildren()) do
	if v:IsA("BasePart") then
		v:Destroy()
	end
end

PhysicsService = game:GetService("PhysicsService")

-- Why did you do this to me, no fling script?
for i,v in pairs(char:GetDescendants()) do
	if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
		PhysicsService:SetPartCollisionGroup(v, "NoFling")
	end
end
particleStorage = game.ReplicatedStorage.PlayerStorage.Effects
local attach0 = Instance.new("Attachment");
attach0.Name = "Trail0";
attach0.CFrame = CFrame.new(0, 0, 0);
if isR15 then
	attach0.Parent = char:WaitForChild("LowerTorso")
else
	attach0.Parent = char:WaitForChild("Torso")
end

local attach1 = Instance.new("Attachment");
attach1.Name = "Trail1";
attach1.CFrame = CFrame.new(0, char.HumanoidRootPart.Size.y/2, 0);
if isR15 then
	attach1.Parent = char:WaitForChild("LowerTorso")
else
	attach1.Parent = char:WaitForChild("Torso")
end

local trail = particleStorage:WaitForChild("AirTrail"):Clone();
trail.Name = "AirTrail";
trail.Attachment0 = attach0;
trail.Attachment1 = attach1;
trail.Parent = char;

AnimationTracks = char.Humanoid:GetPlayingAnimationTracks()
char:WaitForChild("Animate"):Destroy()
for i, track in pairs (AnimationTracks) do
	track:Stop()
end
local landedfromgp = Instance.new("BoolValue",char)
landedfromgp.Value = false
landedfromgp.Name = "HitfloorGP"

local pose = "None"

local grounded = true

local sleeptimer = 0
local bored = false

--WalkAnim:GetMarkerReachedSignal("Step"):connect(function()
--	-- when the marker has reached the "Step" signal, do the funny dust and also play the step sfx
--	if hum.FloorMaterial ~= Enum.Material.Sand then -- Check to make sure that the player is currently not stepping on sand
--		Effects.Dust(char, 0.2)
--	end
--	if pose ~= "Jumping" and pose ~= "Falling" and pose ~= "Standing" and not LongJumping and not Diving and grounded and hum.FloorMaterial ~= Enum.Material.Air then
--		Sounds.PlaySound(char, script.step.SoundId, script.step.Volume, script.step.PlaybackSpeed)
--	end
--end)

game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)

local chara = workspace:WaitForChild(plr.Name)
local human = chara.Humanoid

local GFX = Instance.new("Model",char)
GFX.Name = "GFX"

local speed = 0
OnSlope = false
cananimate = true

--char.HumanoidRootPart:FindFirstChild("Running").Volume = 0 -- Turn off the default run sound effect.

human.Running:connect(function(s)
	speed = s
end)
local update = game:GetService("RunService")

-- Build a "RaycastParams" object
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
raycastParams.FilterDescendantsInstances = {char, char:WaitForChild("GFX"), workspace.CurrentCamera}
raycastParams.IgnoreWater = true

local AbilityVars = require(script.AbilityVars)
local AbilityAnims = require(script.Core.core_abilityanims)

AbilityVars.Trail = trail

local doAction = setmetatable({
	Dive = require(script.Core.core_dive);
	DiveSlideM = require(script.Core.core_diveslide);
	DiveCancel = require(script.Core.core_cancelslide);
    LongJumpM = require(script.Core.core_longjump);
    BackflipM = require(script.Core.core_backflip);
    GroundPoundM = require(script.Core.core_groundpound);
}, {__index = function() return function() end end})

update.RenderStepped:connect(function()
	local ray = workspace:Raycast(chara.HumanoidRootPart.Position, Vector3.new(0,-3000,0), raycastParams)
	local rootvel = math.floor(rootpart.Velocity.Y)
	if ray then
		local position = ray.Position
		local dis = (chara.HumanoidRootPart.Position - position).magnitude
		if dis > 3.8 and chara.HumanoidRootPart.Velocity.Y > 1 then
			pose = "Jumping"
			grounded = false
		end
		if dis> 3.8 and chara.HumanoidRootPart.Velocity.Y < -1 then
			pose = "Falling"
			grounded = false
		end
		if dis < 4 and AbilityVars.GroundPounding then
			AbilityVars.hitfloor = true
		end
		if dis < 3.8 and hum.MoveDirection == Vector3.new(0,0,0) then
			pose = "Standing"
			grounded = true
		end
		if dis < 3.8 and hum.MoveDirection ~= Vector3.new(0,0,0) then
			pose = "Walking"
			grounded = true
		end
	else
	    if chara.HumanoidRootPart.Velocity.Y > 0 and not grounded then
		   pose = "Jumping"
		   grounded = false
    	end
	    if chara.HumanoidRootPart.Velocity.Y < 0 and not grounded then
		   pose = "Falling"
		   grounded = false
	    end
		if hum.MoveDirection == Vector3.new(0,0,0) and grounded then
		   pose = "Standing"
		   grounded = true
	    end
		if hum.MoveDirection ~= Vector3.new(0,0,0) and grounded then
		    pose = "Walking"
		    grounded = true
	    end
	end
	-- Slope Physics
	if rootvel > 5 and not Diving and grounded and States:GetState() == "Default" and not Crouching then
		char.Humanoid.WalkSpeed = math.clamp(char.Humanoid.WalkSpeed - 0.2, 25, 35)
		OnSlope = true
		if AbilityVars.DiveSliding == true then
			AbilityVars.DiveSpeed = math.clamp(AbilityVars.DiveSpeed - 1, 0, 50)
		end
	elseif rootvel < -4 and not Diving and grounded and States:GetState() == "Default" and not Crouching then
		if States:GetState() == "Default" then
			char.Humanoid.WalkSpeed = math.clamp(char.Humanoid.WalkSpeed + 0.2, 0, 35)
		end
		OnSlope = true
		if AbilityVars.DiveSliding == true then
			AbilityVars.DiveSpeed = math.clamp(AbilityVars.DiveSpeed + 4, 0, 50)
		end
	elseif rootvel <= 0 and rootvel >= -4 and pose == "Walking" and grounded then
		OnSlope = false
	end
    hrp.CanCollide = true
end)

workspace.CurrentCamera.CameraType = Enum.CameraType.Follow
workspace.CurrentCamera.CameraSubject = char.Humanoid

coroutine.wrap(function()
	while true do
		wait()
		if AbilityVars.DiveSliding then
			Effects.Dust(char, 0.2)
			wait(0.02)
		end
		if WallJumping then
			Effects.WalljumpDust(char, 0.2)
            wait(0.02)
		end
	end
end)()
stage = 0
JumpStage = 0
triplejumping = false
doublejump = false
backflipping = false
jumping = false
rootpart = char.HumanoidRootPart
rootpart:WaitForChild("Jumping").Pitch = 0

DoubleJumpHeight = 75
TripleJumpHeight = 95
RegularJumpHeight = char.Humanoid.JumpPower

-- Jumps --
function onJump(val)
	jumping = val
	if jumping == true then
		backflipping = false
	end
	if jumping == true and JumpStage > 1 and JumpStage < 3 then
		if hum.MoveDirection == Vector3.new(0,0,0) then
			LongJumping = false
			JumpStage = 0
			doublejump = false
			OnSlope = false
			DoubleJumpAnim:Stop()
			Sounds.PlaySound(char, "rbxasset://sounds/action_jump.mp3", 3, 1)
			local chance = math.random(1,2)
			if chance == 1 then
				Jump1Anim:Play(FadeAmount2)
			else
				Jump2Anim:Play(FadeAmount2)
			end
			return
		end
        trail.Enabled = true
		grounded = false
		OnSlope = false
		    JumpStage = 3
	     	triplejumping = true
		    TripleJumpAnim:Play(FadeAmount2)
		    Sounds.PlaySound(char, "rbxasset://sounds/action_jump.mp3", 3, 2)
			local val = TripleJumpHeight + (char.Humanoid.WalkSpeed / 4)
			char.HumanoidRootPart.Velocity = Vector3.new(0, val, 0)
	        JumpStage = 0
			--if canShowTrails.Value ~= false then
			--	plrTrail.Enabled = true;
			--end
			triplejumping = true
	elseif jumping == true and JumpStage >= 1 and JumpStage < 2 then 
		if hum.MoveDirection == Vector3.new(0,0,0) then
			LongJumping = false
			OnSlope = false
			grounded = false
			JumpStage = 0
			doublejump = false
			DoubleJumpAnim:Stop()
			Sounds.PlaySound(char, "rbxasset://sounds/action_jump.mp3", 3, 1)
			local chance = math.random(1,2)
			if chance == 1 then
				Jump1Anim:Play(FadeAmount2)
			else
				Jump2Anim:Play(FadeAmount2)
			end
			return
		end
			JumpStage = 2
	       	Sounds.PlaySound(char, "rbxasset://sounds/action_jump.mp3", 3, 1.5)
            local val = DoubleJumpHeight + (char.Humanoid.WalkSpeed / 4)
		    char.HumanoidRootPart.Velocity = Vector3.new(0, val, 0)
			--PlayAnimation("DoubleJump")
			doublejump = true
	elseif jumping == true and JumpStage < 1 and backflipping ~= true then 
		    grounded = false
	    	OnSlope = false
		    JumpStage = 1
		    doublejump = false
			local val = RegularJumpHeight + (char.Humanoid.WalkSpeed / 4)
			char.HumanoidRootPart.Velocity = Vector3.new(0, val, 0)
		    Sounds.PlaySound(char, "rbxasset://sounds/action_jump.mp3", 3, 1)
		    triplejumping = false
	end 
end

GroundPounding = require(script:WaitForChild("GroundPoundEnabled"))
canGroundPound = true 
hitfloor = true
function GroundPound()
	if AbilityVars.canGroundPound == true then
		AbilityAnims.GroundPoundAnim = GroundPoundAnim
		AbilityAnims.GroundPoundStartA = GroundPoundStartA
		doAction["GroundPoundM"]()
	end
end

function Backflip()
	if AbilityVars.backflipping ~= true  then
        cananimate = true
	    doAction["BackflipM"]()
	end
end

hum.Jumping:connect(onJump)
local UserInputService = game:GetService("UserInputService")
local jump = false
UserInputService.JumpRequest:Connect(function()
	if humanoid.FloorMaterial == Enum.Material.Air then
		jump = true
		humanoid.JumpPower = 0
	end
end)
deb = 1
UserInputService.InputBegan:connect(function(inputObject)
	if inputObject.KeyCode == Enum.KeyCode.Space or inputObject.KeyCode == Enum.KeyCode.ButtonA then
		if jump == false then
			humanoid.JumpPower = 50
			humanoid.Jump = true
		end
	elseif inputObject.KeyCode == Enum.KeyCode.LeftControl or inputObject.KeyCode == Enum.KeyCode.ButtonR2 then
		-- do funny crouch if grounded 
		CrouchReal()
	end
end)

UserInputService.InputEnded:connect(function(inputObject)
	if inputObject.KeyCode == Enum.KeyCode.Space or inputObject.KeyCode == Enum.KeyCode.ButtonA then
		jump = false
	elseif inputObject.KeyCode == Enum.KeyCode.LeftControl or inputObject.KeyCode == Enum.KeyCode.ButtonR2 then
		-- uncrouch the player
		UncrouchReal()
	end
end)
-- done lol

falling = false

-- Jump Timeout --
function onFall(val)
	falling = val
	if val == false then	--When player lands...
		wait(0.25)			--Next jump times out after .2 seconds.
		if JumpStage > 0 and falling == false then
			JumpStage = 0		--Resets jumps.
		end
	end
end
hum.FreeFalling:connect(onFall)

FadeAmount = 0.3 
FadeAmount2 = 0.15

hum.Died:connect(function()
	script:Destroy()
end)

Crouching = false
LongJumping = false
Diving = false
canDive = true
diveCount = 0
totalDives = 0

humanoid = hum
hrp = rootpart

function Dive()
	if AbilityVars.canDive ~= false then
        AbilityAnims.DiveAnim = DiveAnim
		doAction["Dive"]()
	end
end


function CrouchReal()
	if AbilityVars.GroundPounding ~= true and AbilityVars.LongJumping ~= true and AbilityVars.Diving ~= true and WallJumping ~= true and doublejump ~= true and pose ~= "Jumping" and pose ~= "Freefall" and grounded then
		AbilityVars.Crouching = true
		OnSlope = true
		AbilityVars.backflipping = false
		char.Humanoid.WalkSpeed = 5
		char.Humanoid.JumpPower = 0
	    cananimate = false
	    for i, track in pairs (AnimationTracks) do
		   track:Stop()
	    end
		CrouchAnim:Play()
	end
	if not grounded and not AbilityVars.Diving then 
		GroundPound()
        AbilityVars.Crouching = false
	end
end

function UncrouchReal()
	if not AbilityVars.LongJumping and not AbilityVars.Diving and not AbilityVars.DiveSliding and pose ~= "Jumping" and pose ~= "Freefall" and grounded then
	AbilityVars.Crouching = false
	OnSlope = false
	cananimate = true
	char.Humanoid.JumpPower = 50
	CrouchAnim:Stop()
	end
end

function LongJump()
	if AbilityVars.Crouching == true and AbilityVars.GroundPounding ~= true and AbilityVars.LongJumping ~= true and AbilityVars.Diving ~= true and AbilityVars.WallJumping ~= true and doublejump ~= true and grounded then
	   AbilityAnims.LongJumpAnim = LongJumpAnim
       doAction["LongJumpM"]()
	end
end


function DiveSlide()
	AbilityAnims.DiveSAnim = DiveSAnim
	doAction["DiveSlideM"]()
end

function CancelSlide()
    AbilityAnims.RollAnim = TripleJumpAnim
    doAction["DiveCancel"]()
end

UserInputService = game:GetService("UserInputService")
UserInputService.JumpRequest:connect(function()
	if AbilityVars.DiveSliding then
		CancelSlide()
	elseif AbilityVars.Crouching and hum.MoveDirection ~= Vector3.new(0,0,0) then
		LongJump()
	elseif AbilityVars.Crouching and hum.MoveDirection == Vector3.new(0,0,0) then
		Backflip()
	end
end)

RunService = game:GetService("RunService")

WallJumpSoundURL = "rbxasset://sounds/action_jump.mp3"
WallAttachSoundURL = "rbxasset://sounds/action_jump_land.mp3"
WallGripDuration = 1
JumpCooldown = 0.1
GrabCooldown = 0.1

Humanoid = script.Parent.Humanoid
RootPart = Humanoid.RootPart
WallJumpAnimTrack = nil

WallGripLeft = 0 -- To make players fall off eventually.
JumpWait = 0 -- To prevent accidental auto-jumping.
GrabWait = 0 -- To prevent players grabbing the wall forever with shift-lock.
CurrentConstraint = nil
CurrentAttachment = nil
OldWalkspeed = 0
GripLookVector = Vector3.new(0, 0, -1)
WallJumpSound = Instance.new("Sound")
WallJumpSound.Name = "WallJumpSound"
WallJumpSound.SoundId = WallJumpSoundURL
WallJumpSound.Volume = 4
WallJumpSound.Parent = RootPart
onwall = false
function LoseGrip()
	WallJumping = false
	WallGripLeft = 0
	OnSlope = false
	hum.AutoRotate = true
	GrabWait = GrabCooldown
	CurrentConstraint = nil
	CurrentAttachment = nil
	WallJumpAnim:Stop()
	cananimate = true
	Humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
	local bodyvel = rootpart:FindFirstChild("BodyVelocity")
	if bodyvel then
		bodyvel:Destroy()
	end
end
function Land()
	WallJumping = false
	WallGripLeft = 0
	OnSlope = false
	hum.AutoRotate = true
	GrabWait = GrabCooldown
	CurrentConstraint = nil
	CurrentAttachment = nil
	WallJumpAnim:Stop()
	cananimate = true
	local bodyvel = rootpart:FindFirstChild("BodyVelocity")
	if bodyvel then
		bodyvel:Destroy()
	end
end
RunService.Heartbeat:Connect(function(deltaTime)
	if CurrentConstraint == nil and Humanoid:GetState() == Enum.HumanoidStateType.Freefall and not Scootering then
		-- When the character is falling in front of a wall, attach it to the wall.
		local ray = Ray.new(RootPart.Position, RootPart.CFrame.LookVector * 1.5)
		local ray2 = Ray.new(rootpart.Position, RootPart.CFrame.LookVector * -1.5)
		local hit, point, normal = workspace:FindPartOnRay(ray, char)
		local hit2, point2, normal2 = workspace:FindPartOnRay(ray2, char)
		if hit ~= nil then
			    local hitTag = hit:FindFirstChild("_Wall")
			    if hitTag == nil then
			    -- Temporarily attach the Humanoid to the wall.|
			    if hit.CanCollide ~= false and hit.Transparency ~= 1 then
				WallJumping = true
				JumpStage = 0
			    local normalCFrame = hit.CFrame:ToObjectSpace(CFrame.new(Vector3.new(0, 0, 0), normal))
			    normalCFrame = normalCFrame - normalCFrame.Position
			    local offsetCFrame = CFrame.new((hit.CFrame:inverse() * RootPart.CFrame).Position)
				local newCFrame = hit.CFrame * offsetCFrame * normalCFrame
				for i, track in pairs (AnimationTracks) do
					track:Stop()
				end
			    cananimate = false
			    WallJumpAnim:Play()
			    OnSlope = true
			    hum.AutoRotate = false
			    Sounds.PlaySound(char, WallAttachSoundURL, 3, 1)
			    local BodyVelocity = Instance.new("BodyVelocity",rootpart)
			    BodyVelocity.Velocity = Vector3.new(0,-10,0)
			    BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
			    RootPart.CFrame = newCFrame
			    GripLookVector = newCFrame.LookVector
			    WallGripLeft = WallGripDuration
				JumpWait = JumpCooldown
				end
			end
		elseif hit2 == nil and WallJumping then
			LoseGrip()
		end
	end
end)
Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
	-- When the character jumps and they're attached to a wall, propel them away from it.
	if WallJumping and Humanoid.Jump and JumpWait >= 0 then
		LoseGrip()
		Sounds.PlaySound(char, WallJumpSoundURL, 3, 1)
		triplejumping = false
		doublejump = false
		RootPart.Velocity = Vector3.new(0, 50 * 1.1, 0) + (GripLookVector * 50)
	end
end)

TweenService = game:GetService("TweenService")
CameraTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)


WallJumping = false
hum.StateChanged:connect(function(old, new)
	if AbilityVars.Diving and old == Enum.HumanoidStateType.Flying then
	AbilityVars.Diving = false
	AbilityVars.canDive = true
	Sounds.PlaySound(char, rootpart:WaitForChild("Landing").SoundId, 3, 1)
	char.Humanoid.JumpPower = 0
	char.HumanoidRootPart:FindFirstChild("Running").Volume = 1
	DiveSlide()
	elseif new == Enum.HumanoidStateType.Landed and old == Enum.HumanoidStateType.Freefall then
        triplejumping = false
		TripleJumpAnim:Stop() 
		trail.Enabled = false
		jump = false
		grounded = true
		Land()
		Effects.LandEffect(char, 1.7, 8)
		Sounds.PlaySound(char, rootpart:WaitForChild("Landing").SoundId, 3, 1)
	elseif AbilityVars.LongJumping and old == Enum.HumanoidStateType.Flying then
		if new == Enum.HumanoidStateType.Running or new == Enum.HumanoidStateType.RunningNoPhysics then
			AbilityVars.LongJumping = false
			AbilityVars.cananimate = true
            cananimate = true
			OnSlope = false
            trail.Enabled = false
			char.Humanoid.WalkSpeed = 34
			Sounds.PlaySound(char, rootpart:WaitForChild("Landing").SoundId, 3, 1)
			Effects.LandEffect(char, 1.7, 8)
			char.HumanoidRootPart:FindFirstChild("Running").Volume = 1
        end
	elseif old == Enum.HumanoidStateType.Flying then
		if new == Enum.HumanoidStateType.Running or new == Enum.HumanoidStateType.RunningNoPhysics then
			Sounds.PlaySound(char, rootpart:WaitForChild("Landing").SoundId, 3, 1)
			Effects.LandEffect(char, 1.7, 8)
			TripleJumpAnim:Stop()
			triplejumping = false
			cananimate = true
			char.HumanoidRootPart:FindFirstChild("Running").Volume = 1
		end
	end
	if new == Enum.HumanoidStateType.Running or new == Enum.HumanoidStateType.RunningNoPhysics then
		grounded = true
	elseif new == Enum.HumanoidStateType.Freefall or new == Enum.HumanoidStateType.Jumping then
		grounded = false
	end
	if AbilityVars.backflipping and old == Enum.HumanoidStateType.Flying then
		if new == Enum.HumanoidStateType.Running or new == Enum.HumanoidStateType.RunningNoPhysics then
			AbilityVars.backflipping = false
			Sounds.PlaySound(char, rootpart:WaitForChild("Landing").SoundId, 3, 1)
			Effects.LandEffect(char, 1.7, 8)
		end
	end
	if AbilityVars.GroundPounding and old == Enum.HumanoidStateType.Freefall then
		AbilityVars.hitfloor = true
		AbilityVars.backflipping = false
        JumpStage = 1
		wait(0.35)
		JumpStage = 0
	end
end)
local function dive(actionName, inputState, inputObject)
	if inputState == Enum.UserInputState.Begin and AbilityVars.GroundPounding ~= true and WallJumping ~= true then
		Dive()
	end
end
local ContextActionService = game:GetService("ContextActionService")
ContextActionService:BindAction("Dive", dive, true, Enum.KeyCode.LeftShift, Enum.KeyCode.ButtonB)

lowhp = false
coroutine.wrap(function()
	while true do
		wait()
		AnimationTracks = char.Humanoid:GetPlayingAnimationTracks()
		WalkAnim:AdjustSpeed(math.clamp(char.Humanoid.WalkSpeed / 15, 0, 2))
        --print(sleeptimer)
		if pose == "Walking" and cananimate and AbilityVars.cananimate == true then
			if char.Humanoid.WalkSpeed < 36 then
				stage = 1
				if not OnSlope and hum.WalkSpeed < 25 then
					if States:GetState() == "Default" then
						char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + 0.6
					end
				end
				if char.Humanoid.WalkSpeed > 25 then
					char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed - 0.1
				end
				for i, track in pairs (AnimationTracks) do
					if track ~= WalkAnim and track ~= TripleJumpAnim then
						track:Stop()
					end
				end
				    if stage ~= 2 and stage ~= 3 then
					    if WalkAnim.IsPlaying ~= true then
						WalkAnim:Play()
					    end
				    end
			    end
			end
		if pose == "Standing" and cananimate and AbilityVars.cananimate == true then
			if States:GetState() == "Default" then
				char.Humanoid.WalkSpeed = 13
			end
			for i, track in pairs (AnimationTracks) do
				if track ~= IdleAnim then
					track:Stop()
				end
			end
			if IdleAnim.IsPlaying ~= true then
                IdleAnim:Play()
			end
		elseif pose == "Jumping" and cananimate and AbilityVars.cananimate == true then
			for i, track in pairs (AnimationTracks) do
				if track ~= Jump1Anim and track ~= Jump2Anim and track ~= DoubleJumpAnim and track ~= TripleJumpAnim and track ~= BackflipAnim then
					track:Stop(FadeAmount2)
				end
			end
			if Jump1Anim.IsPlaying ~= true and Jump2Anim.IsPlaying ~= true and DoubleJumpAnim.IsPlaying ~= true and TripleJumpAnim.IsPlaying ~= true and BackflipAnim.IsPlaying ~= true then
				if doublejump ~= true and triplejumping ~= true and AbilityVars.backflipping ~= true then
                    TripleJumpAnim:Stop()
                    DoubleJumpAnim:Stop()
                    BackflipAnim:Stop()
					local chance = math.random(1,2)
					if chance == 1 then
						Jump1Anim:Play(FadeAmount2)
					else
						Jump2Anim:Play(FadeAmount2)
					end
				elseif doublejump and triplejumping ~= true and AbilityVars.backflipping ~= true then
					DoubleJumpAnim:Play(FadeAmount2)
				elseif triplejumping and doublejump ~= true and AbilityVars.backflipping ~= true then
					TripleJumpAnim:Play(FadeAmount2)
				elseif AbilityVars.backflipping and doublejump ~= true and triplejumping ~= true then
					BackflipAnim:Play()
				end
			end
		elseif pose == "Falling" and cananimate and AbilityVars.cananimate == true  then
			for i, track in pairs (AnimationTracks) do
				if track ~= FallAnim and track ~= TripleJumpAnim then
					track:Stop(FadeAmount)
				end
			end
			if FallAnim.IsPlaying ~= true then
				if TripleJumpAnim.IsPlaying ~= true then
					FallAnim:Play(FadeAmount)
				end
			end
		end
	end
end)()

Main Script

Here is an ability that’s animations doesn’t play in the game but works in others.

-- Core ability script wrote by Theamazingnater
char = game.Players.LocalPlayer.Character
humanoid = char:WaitForChild("Humanoid")
rootpart = char:WaitForChild("HumanoidRootPart")
hrp = rootpart

local AbilityVars = require(script.Parent.Parent:WaitForChild("AbilityVars"))
local Sounds = require(script.Parent.Parent:WaitForChild("Sounds"))
local Anims = require(script.Parent:WaitForChild("core_abilityanims"))
local GroundPounding = require(script.Parent.Parent:WaitForChild("GroundPoundEnabled"))

-- Trails are disabled... for now.

return function()
	GroundPounding.groundpoundenabled = true
	print(GroundPounding.groundpoundenabled)
	local AnimationTracks = char.Humanoid:GetPlayingAnimationTracks()
	char.Humanoid.WalkSpeed = 0 
	AbilityVars.LongJumping = false
	AbilityVars.GroundPounding = true
	AbilityVars.backflipping = false
	AbilityVars.canGroundPound = false
	AbilityVars.cananimate = false
	AbilityVars.hitfloor = false
	AbilityVars.Crouching = false
	for i, track in pairs (AnimationTracks) do
		track:Stop()
	end
	humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
	Anims:PlayAnimation("GroundPound")
	Sounds.PlaySound(char, "rbxasset://sounds/action_jump.mp3", 3, 1.5)
	local vel = Instance.new("BodyVelocity",char.HumanoidRootPart)
	vel.Velocity = Vector3.new(0,0,0)
	vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
	vel.Name = "GroundPoundVelocity"
	wait(0.5)
	AbilityVars.Trail.Enabled = true
	vel.Velocity = char.HumanoidRootPart.CFrame.upVector * -75
	Anims:StopAnimation("GroundPoundS")
	Anims:PlayAnimation("GroundPound")
	repeat wait() until AbilityVars.hitfloor == true
	AbilityVars.Trail.Enabled = false
	AbilityVars.canGroundPound = true
	Anims:StopAnimation("GroundPound")
	vel:Destroy()
	AbilityVars.hitfloor = false
	AbilityVars.GroundPounding = false
	AbilityVars.cananimate = true
    char:WaitForChild("HitfloorGP").Value = true
    wait(0.2)
	char:WaitForChild("HitfloorGP").Value = false
end

image

Took me way too long to figure it out, There was already a Model named my username in workspace.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.