Idk why this script isn't working, no errors

I am creating a party system for a game, in the script that updates the current party gui, nothing is being updated or printed (+ no error or warn messages), Have I put any errors in the script?

function UpdateParty()
	local inparty = nil
	local partyhost = false

	for i,v in pairs(game.ReplicatedStorage:WaitForChild("Partys"):GetChildren()) do
		if v:IsA("StringValue") then
			if v:GetAttribute("Host") == game.Players.LocalPlayer.Name then
				partyhost = true
				inparty = v

				print("Found Party")

			elseif v:GetAttribute("Player2") == game.Players.LocalPlayer.Name or v:GetAttribute("Player3") == game.Players.LocalPlayer.Name or v:GetAttribute("Player4") == game.Players.LocalPlayer.Name then
				inparty = v

				print("Found Party")

			end
		end
	end

	if inparty == nil then
	else
		for i, v in pairs(script.Parent:WaitForChild("PartyMembers"):WaitForChild("Frame")) do
			if v:IsA("ImageLabel") then
				v:Destroy()
			end
		end

		script.Parent:WaitForChild("Icon").Image = "rbxassetid://".. inparty.Value:GetAttribute("Thumbnail")
		script.Parent:WaitForChild("JoinCode"):WaitForChild("TextLabel").Text = "Code: ".. inparty.Name

		for i,v in pairs(inparty:GetAttributes()) do
			if v.Name == "Host" or v.Name == "Player2" or v.Name == "Player3" or v.Name == "Player4" then	
				if game.Players:WaitForChild(v) then
					local template = script:WaitForChild("Template"):Clone()

					template.Name = v.Name

					local findplr = game.Players:WaitForChild(v)
					template:WaitForChild("Frame"):WaitForChild("PlrName").Text = findplr.DisplayName.. " @".. findplr.Name

					template:WaitForChild("Frame"):WaitForChild("PlrIcon"):WaitForChild("Icon").Image = "https://www.roblox.com/headshot-thumbnail/image?userId=".. findplr.UserId.. "&width=420&height=420&format=png"

					template.Parent = script.Parent:WaitForChild("PartyMembers"):WaitForChild("Frame")
				end
			end
		end

		if partyhost == true then
			script.Parent:WaitForChild("Start"):WaitForChild("Start").Visible = true
		else
			script.Parent:WaitForChild("Start"):WaitForChild("Start").Visible = false
		end
	end
end

UpdateParty()

for i,v in pairs(game.ReplicatedStorage:WaitForChild("Partys"):GetChildren()) do
	if v:IsA("StringValue") then
		if v:GetAttribute("Host") == game.Players.LocalPlayer.Name or  v:GetAttribute("Player2") == game.Players.LocalPlayer.Name or v:GetAttribute("Player3") == game.Players.LocalPlayer.Name or v:GetAttribute("Player4") == game.Players.LocalPlayer.Name then
			v.Changed:Connect(function()
				UpdateParty()
				print("Updating Party Gui")
			end)
		end
	end
end

I think I found the error. I must have put the wrong instance in some places