Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

sound:Play() on line 77 keeps looping no matter what I do?

Asked by 5 years ago

Recently I have taken up the hobby of coding; however it has been a rough start. Thanks to this forum's help, I have been able to script an almost working Summon script for a game. Just as a tested the script for the last run, I ran into a problem where the script loops itself even though function has ended. I figured out somewhat that the problem may be coming from the IsTyping command as nothing happens when I move; however I have now idea how to fix it as I have only been coding for 2 or 3 days and the script is an amalgamation of multiple tutorials and solutions. How do I fix this problem.

Here is the code if it helps (Problem targets: Lines 77 and 13)

001local UIS = game:GetService('UserInputService')
002local plr = game.Players.LocalPlayer
003local Char = plr.Character or plr.CharacterAdded:Wait()
004 
005local key = 'L'
006 
007local Anim = Instance.new("Animation")
008Anim.AnimationId = 'rbxassetid://4906894017'
009 
010local Debounce = true
011 
012UIS.InputBegan:Connect (function(Input, IsTyping)
013    if IsTyping then return
014 
015    end
View all 137 lines...

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

in the propertis of the sound there should be a line looped so turn it off

if it doesnt work try putting

1local Anim = Instance.new("Animation")
2Anim.AnimationId = 'rbxassetid://4906431432'

local LoadAnimation = character.Humanoid:LoadAnimation(Anim) LoadAnimation:play() sound:Stop()

instead of

if game.Workspace.ChargeUpBOOM.IsPlaying then wait(2) sound:Destroy() sound=nil return end end)

0
still doesn't work; here's a video to describe what is happening since I have trouble elaborating stuff over text. https://youtu.be/7LpiHicHVrU Crimsonknightzone 38 — 5y
0
Try putting like after sound:play() wait(1) sound:stop() themaxogamer 58 — 5y
Ad

Answer this question