Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local animationId = "rbxassetid://118566032629346"
- local soundId = "rbxassetid://85155550378142"
- -- Load the animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animator = player.Character:FindFirstChildOfClass("Humanoid"):FindFirstChildOfClass("Animator")
- local animationTrack = animator:LoadAnimation(animation)
- -- Load the sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = player.Character
- -- Adjust the playback speed of the sound to make it play faster
- sound.PlaybackSpeed = 4 -- Set sound playback speed to 4
- -- Fire the Dribble remote event
- game:GetService("ReplicatedStorage").Packages.Knit.Services.BallService.RE.Dribble:FireServer()
- -- Clone the visual effect
- local effects = ReplicatedStorage.Assets.Vfx.BigBangTrail.VFX:Clone()
- local football = player.Character:FindFirstChild("Football")
- if football then
- effects.Parent = football
- else
- warn("Football not found in character.")
- return
- end
- -- Play the sound and animation
- sound:Play()
- animationTrack:Play()
- -- Adjust the speed of the animation to 4
- animationTrack:AdjustSpeed(4) -- Set animation speed to 4
- -- Wait for the animation to finish
- animationTrack.Stopped:Wait()
- -- Fire the Shoot remote event
- local args = { [1] = 200 }
- game:GetService("ReplicatedStorage").Packages.Knit.Services.BallService.RE.Shoot:FireServer(unpack(args))
- -- Clean up the effects after the animation ends
- wait(12) -- Wait for the duration of the effect
- effects:Destroy()
- sound:Destroy() -- Optionally destroy the sound after use
Advertisement
Add Comment
Please, Sign In to add comment