Script doesn't work?

Hello! So I am making a part that if you touch it, it will fire a client. I want it to show a gui for that player who touched it. It seems that the first script works but the gui script doesn’t.

First Script

local badgeService = game:GetService("BadgeService")
local badge = 2129022874

script.Parent.Touched:Connect(function(partB)
	local humanoid = partB.Parent:FindFirstChild("Humanoid")
	if humanoid then
		local player = game.Players:GetPlayerFromCharacter(partB.Parent)
		game.ReplicatedStorage.Voiceline:FireClient(player)
			local hasBadge = badgeService:UserHasBadgeAsync(player.UserId, badge)
			if hasBadge then
				--player has badge
			else
			badgeService:AwardBadge(player.UserId, badge)
				print("Worked")
		end
	end
end)

Second LocalScript

while wait(0.1) do
	if script.Parent.ImageLabel.Visible == true then
		script.Parent.Glitch:Play()
		script.Parent.ImageLabel.Visible = true
		game.Lighting.Ambient = Color3.new(1, 0, 0)
		wait(2)
		script.Parent.Glitch:Stop()
		script.Parent.ImageLabel.Visible = false
	end	
end


game.ReplicatedStorage.Voiceline.OnClientEvent:Connect(function()
	print("touched")
	game.Workspace.Map.GlitchPart:Destroy()
	script.Parent.ImageLabel.Visible = true
	script.Parent.Sound:Play()
	script.Parent.VoiceLine:Play()
	wait(1)
	script.Parent.TextLabel.Visible = true
	wait(3)
	script.Parent.TextLabel.Visible = false
	game.Lighting.Ambient = Color3.new(0, 0, 0)
end)

you have the function under a while true loop…
code doesn’t run after a while loop, once the code gets to the end of the loop it does as it’s supposed to and loops back to the top of the loop and therefore never gets to your function.
You can put the function above the loop or you can put the loop in a spawn function but there isn’t a need for that if you can just move the loop under the function