-
What do you want to achieve? Make my script play the music 1 time only.
-
What is the issue? My script plays a music 100 times instead of only 1 time.
-
What solutions have you tried so far? I tried to look at dev Hub but nothing.
while wait() do
local Player = game:GetService("Players")
local player = Player.LocalPlayer
local power = script.Parent
if script.Parent.Value == 43 then
local kills5 = Instance.new("Sound",player.Character.Humanoid.Torso)
kills5.SoundId = "rbxassetid://10636340314"
kills5.Looped = true
kills5.Volume = 2.2
kills5:Play()
player.Character.Humanoid.WalkSpeed = 28
end
if script.Parent.Value == 66 then
local kills10 = Instance.new("Sound",player.Character.Humanoid.Torso)
kills10.SoundId = "rbxassetid://10662472899"
kills10.Looped = true
kills10.Volume = 2.2
kills10:Play()
player.Character.Humanoid.WalkSpeed = 45
end
end
What i have to do to play the music 1 time only?