Gui not working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want this challenge gui to pop up after you completed a challenge.

  2. What is the issue? Include screenshots / videos if possible!
    The challenge doesn’t pop up and when you complete 2 challenges at the exact same time only one will be seen.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried to activate the popup through a button, it shows and workes like a charm. But when I do it through a remote event it only shows in the output that the code is running but I don’t see anything

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Here is my code

local function ChallengeCompleted(Challenge, Reward1, Reward2, Reward3)
	print("Running Code")
	local Debounce1 = false
	local Debounce2 = false
	local Debounce3 = false
	local Debounce4 = false
	local Debounce5 = false
	local Debounce6 = false
	local Debounce7 = false
	local Debounce8 = false
	local Debounce9 = false
	local Debounce10 = false
	if Debounce1 == false then
		Debounce1 = true
		local ChallengeGui = game.Players.LocalPlayer.PlayerGui.ChallengeGui.Challenge
		ChallengeGui.Challenge.Text = Challenge
		ChallengeGui:TweenPosition(UDim2.new(0, 0, 0.299, 0), nil, nil, 1)
		wait(2)
		if Reward1 then
			ChallengeGui.Challenge.Visible = false
			ChallengeGui.Progressbar.Visible = false
			ChallengeGui.Completed.Visible = false
			ChallengeGui.Reward.Text = Reward1
			ChallengeGui.Unlocked.Visible = true
			ChallengeGui.Reward.Visible = true
			wait(1.5)
			if Reward2 then
				ChallengeGui.Reward.Text = Reward2
				wait(1.5)
				if Reward3 then
					ChallengeGui.Reward.Text = Reward3
					wait(1.5)
				end
			end
		end
		ChallengeGui:TweenPosition(UDim2.new(-0.222, 0, 0.299, 0), nil, nil, 1)
		wait(1)
		ChallengeGui.Challenge.Visible = true
		ChallengeGui.Progressbar.Visible = true
		ChallengeGui.Completed.Visible = true
		ChallengeGui.Reward.Visible = false
		ChallengeGui.Unlocked.Visible = false
		Debounce1 = false
	elseif Debounce1 == true then
		if Debounce2 == false then
			Debounce2 = true
			repeat
				wait(0.1)
			until Debounce1 == false
			Debounce1 = true
			local ChallengeGui = game.Players.LocalPlayer.PlayerGui.ChallengeGui.Challenge
			ChallengeGui.Challenge.Text = Challenge
			ChallengeGui:TweenPosition(UDim2.new(0, 0, 0.299, 0), nil, nil, 1)
			wait(2)
			if Reward1 then
				ChallengeGui.Challenge.Visible = false
				ChallengeGui.Progressbar.Visible = false
				ChallengeGui.Completed.Visible = false
				ChallengeGui.Reward.Text = Reward1
				ChallengeGui.Unlocked.Visible = true
				ChallengeGui.Reward.Visible = true
				wait(1.5)
				if Reward2 then
					ChallengeGui.Reward.Text = Reward2
					wait(1.5)
					if Reward3 then
						ChallengeGui.Reward.Text = Reward3
						wait(1.5)
					end
				end
			end
			ChallengeGui:TweenPosition(UDim2.new(-0.222, 0, 0.299, 0), nil, nil, 1)
			wait(1)
			ChallengeGui.Challenge.Visible = true
			ChallengeGui.Progressbar.Visible = true
			ChallengeGui.Completed.Visible = true
			ChallengeGui.Reward.Visible = false
			ChallengeGui.Unlocked.Visible = false
			Debounce1 = false
			Debounce2 = false
		end
	elseif Debounce2 == true then
		if Debounce3 == false then
			Debounce3 = true
			repeat
				wait(0.1)
			until Debounce2 == false
			Debounce2 = true
			Debounce1 = true
			local ChallengeGui = game.Players.LocalPlayer.PlayerGui.ChallengeGui.Challenge
			ChallengeGui.Challenge.Text = Challenge
			ChallengeGui:TweenPosition(UDim2.new(0, 0, 0.299, 0), nil, nil, 1)
			wait(2)
			if Reward1 then
				ChallengeGui.Challenge.Visible = false
				ChallengeGui.Progressbar.Visible = false
				ChallengeGui.Completed.Visible = false
				ChallengeGui.Reward.Text = Reward1
				ChallengeGui.Unlocked.Visible = true
				ChallengeGui.Reward.Visible = true
				wait(1.5)
				if Reward2 then
					ChallengeGui.Reward.Text = Reward2
					wait(1.5)
					if Reward3 then
						ChallengeGui.Reward.Text = Reward3
						wait(1.5)
					end
				end
			end
			ChallengeGui:TweenPosition(UDim2.new(-0.222, 0, 0.299, 0), nil, nil, 1)
			wait(1)
			ChallengeGui.Challenge.Visible = true
			ChallengeGui.Progressbar.Visible = true
			ChallengeGui.Completed.Visible = true
			ChallengeGui.Reward.Visible = false
			ChallengeGui.Unlocked.Visible = false
			Debounce1 = false
			Debounce2 = false
			Debounce3 = false
		end
	end
end

game.ReplicatedStorage.RemoteEvents.ChallengeCompleted.OnClientEvent:Connect(ChallengeCompleted)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

I already found a fix for it, simply increase the displayorder for the Gui

1 Like