RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make it that the animations are stored in replicated storage"
-- server script local ReplicatedStorage = game:GetService("ReplicatedStorage") local anim1 = Instance.new("Animation") anim1.AnimationId = "rbxassetid://animation1_id_here" anim1.Parent = ReplicatedStorage local anim2 = Instance.new("Animation") anim2.AnimationId = "rbxassetid://animation2_id_here" anim2.Parent = ReplicatedStorage -- local script local player = game.Players.LocalPlayer local character = player.Character local humanoid = character:FindFirstChild("Humanoid") local animTrack1 = humanoid:LoadAnimation(game:GetService("ReplicatedStorage"):FindFirstChild("Animation1")) local animTrack2 = humanoid:LoadAnimation(game:GetService("ReplicatedStorage"):FindFirstChild("Animation2")) local punching = false local function punch() if punching then punching = false animTrack1:Stop() animTrack2:Play() else punching = true animTrack2:Stop() animTrack1:Play() end end game:GetService("UserInputService").InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.E then punch() end end)