local sound keeps looping and wont break function??
Recently, I've been taking slow steps to code a player "God" script. However, after I figure out a problem, another problem mounts on. This time, local sound on line 76 keeps looping without end and I cant seem to break the function. No matter what I do, the problem gets worse. Any way to break the function permanently?
Here's the code: (Code starts after `)
``
local UIS = game:GetService('UserInputService')
local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local key = 'L'
local Anim = Instance.new("Animation")
Anim.AnimationId = 'rbxassetid://4906894017'
local Debounce = true
UIS.InputBegan:Connect (function(Input, IsTyping)
if IsTyping then return
02 | local KeyPressed = Input.KeyCode |
03 | if KeyPressed = = Enum.KeyCode.L and Debounce then |
05 | local LoadAnimation = Char.Humanoid:LoadAnimation(Anim) |
07 | print ( "The Crimson God Has Been Summoned; Run..." ) |
12 | if CrimGod = = true then |
13 | local sound 1 = game.Workspace.ChargeUp |
19 | local orb = game.Workspace.Part |
22 | local player = game.Players.LocalPlayer |
23 | local character = player.Character or player.CharacterAdded:wait() |
26 | local weld = Instance.new( "WeldConstraint" ) |
27 | weld.Parent = workspace |
29 | weld.Part 1 = character.HumanoidRootPart |
30 | if player.Character:FindFirstChild( "Torso" ) = = nil then |
31 | orb.Position = Vector 3. new (player.Character.LowerTorso.Position.X,player.Character.LowerTorso.Position.Y,player.Character.LowerTorso.Position.Z) |
33 | orb.Position = Vector 3. new (player.Character.Torso.Position.X,player.Character.Torso.Position.Y,player.Character.Torso.Position.Z) |
end
end
01 | local tweenService = game:GetService( "TweenService" ) |
02 | local part = game.Workspace.Part |
03 | local tweeningInformation = TweenInfo.new( |
06 | Enum.EasingStyle.Cubic, |
07 | Enum.EasingDirection.InOut, |
13 | local partProperties = { |
15 | Size = Vector 3. new( 877.04 , 149.27 , 80.24 ); |
19 | local tween = tweenService:Create(part,tweeningInformation,partProperties) |
24 | local sound = game.Workspace.ChargeUpBOOM |
26 | local exppart = game.Workspace.CrimEXP |
29 | local player = game.Players.LocalPlayer |
30 | local character = player.Character or player.CharacterAdded:wait() |
31 | exppart.Material = "Neon" |
32 | local weld = Instance.new( "WeldConstraint" ) |
33 | weld.Parent = workspace |
35 | weld.Part 1 = character.HumanoidRootPart |
36 | if player.Character:FindFirstChild( "Torso" ) = = nil then |
37 | exppart.Position = Vector 3. new (player.Character.LowerTorso.Position.X,player.Character.LowerTorso.Position.Y,player.Character.LowerTorso.Position.Z) |
39 | exppart.Position = Vector 3. new (player.Character.Torso.Position.X,player.Character.Torso.Position.Y,player.Character.Torso.Position.Z) |
end
01 | local tweenService = game:GetService( "TweenService" ) |
02 | local part = game.Workspace.CrimEXP |
03 | part.BrickColor = BrickColor.new( "Crimson" ) |
04 | local tweeningInformation = TweenInfo.new( |
07 | Enum.EasingStyle.Cubic, |
08 | Enum.EasingDirection.InOut, |
14 | local partProperties = { |
16 | Size = Vector 3. new( 877.04 , 149.27 , 80.24 ); |
20 | local tween = tweenService:Create(part,tweeningInformation,partProperties) |
27 | local part = game.Workspace.Part |
31 | local character = plr.Character or plr.CharacterAdded:Wait() |
33 | local Anim = Instance.new( "Animation" ) |
35 | local LoadAnimation = character.Humanoid:LoadAnimation(Anim) |
38 | if game.Workspace.ChargeUpBOOM.IsPlaying then |