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

Infinite yield possible on 'Players.test.PlayerGui:WaitForChild("muted")'? [closed]

Asked by 1 year ago

local plr = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function() if workspace.Music.IsPlaying == true then script.Parent.Image = "rbxassetid://202000870" workspace.Music:Pause() game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.TextTransparency = 0 game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.Visible = true game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.Text = "muted!" local tweenservice = game:GetService("TweenService") local tweenInfo = TweenInfo.new( 0.3,Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false ) local tween = tweenservice:Create(game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel, tweenInfo, {Position = UDim2.new(0.5, 0,0.80, 0)}) tween:Play() wait(2) local tweenservice = game:GetService("TweenService") local tweenInfo = TweenInfo.new( 0.3,Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false ) local tweene = tweenservice:Create(game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel, tweenInfo, {TextTransparency = 1}) tweene:Play() tweene.Completed:Connect(function() game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.Position = UDim2.new(0.5, 0,0.85, 0) game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.Visible = false end) else script.Parent.Image = "rbxassetid://202000937" workspace.Music:Resume() game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.TextTransparency = 0 game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.Visible = true game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.Text = "unmuted!" local tweenservice = game:GetService("TweenService") local tweenInfo = TweenInfo.new( 0.3,Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false ) local tween = tweenservice:Create(game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel, tweenInfo, {Position = UDim2.new(0.5, 0,0.80, 0)}) tween:Play() wait(2) local tweenservice = game:GetService("TweenService") local tweenInfo = TweenInfo.new( 0.3,Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 0, false ) local tweene = tweenservice:Create(game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel, tweenInfo, {TextTransparency = 1}) tweene:Play() tweene.Completed:Connect(function() game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.Position = UDim2.new(0.5, 0,0.85, 0) game.Players.LocalPlayer.PlayerGui:WaitForChild("muted").TextLabel.Visible = false end) end end)

Closed as Not Constructive by theking66hayday and T3_MasterGamer

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 1 year ago

Are you sure that when you're referring to "muted" that it's spelt correctly, with capital letters? That error appears when whatever you're trying to yield something that never existed. (I think, im new to scripting, but still trying to help)

Also, when you're going to copy and paste code make sure you use the lua button in the text editing options, so it makes it more clear.

Ad