Need Help with a text Label

So, basically, I am making a popup and I am trying to change the text of a Texlabel depending on a parts name, but it keeps changing to names the for different parts.
My Script:


local v1 = game.Players.LocalPlayer
local v2 = game.Workspace:WaitForChild(v1.Name)
local v3 = nil
local v4 = nil
local v5 = game.ReplicatedStorage:WaitForChild("Prompt"):Clone()



function Sound1()
	local frame = script.Parent
	v5.Button:TweenSizeAndPosition(UDim2.new(0.768, 0,0.768, 0), UDim2.new(0.116, 0,0.115, 0),	"Out","Quad",.2,true)
	local  v6 = script.Pop
	v6:Play() 
	wait(.75)
	v6:Pause()
end
function Sound2()
	v5.Button:TweenSizeAndPosition(UDim2.new(0.72, 0,0.72, 0), UDim2.new(0.119, 0,0.14, 0),	"Out","Quad",.1,true)
	local v7 = script.Pop2
	v7:Play() 
	wait(.75)
	v7:Pause()
end
function DSize()
	v5.Button:TweenSizeAndPosition(UDim2.new(0.25, 0,0.25, 0), UDim2.new(0.354, 0,0.374, 0),	"Out","Quad",.1,true)

end





v5.Parent = v1:WaitForChild("PlayerGui")
repeat


	wait(0.05)
	if v1.Character.Humanoid.SeatPart == nil and game:IsLoaded()  then
		

		local parts = game.Workspace:GetDescendants()
		for _,p in pairs(parts) do

			if p.Name == "EPart" then
				
				if p.Parent.Name == "NPC" then -- were i change the text!
					v5.Action.Text = "Talk"
				end
				if p.Name == "EPart" then

					if p.Parent.Name == "Box" then
						v5.Action.Text = "Search Box"
					end
					if p.Parent.Name == "Crate" then
						v5.Action.Text = "Search Crate"
					end
end
					
									
			
	
				local Magnitude = (p.Parent.Position-v2.HumanoidRootPart.Position).magnitude
				if Magnitude < 5 then --if they are within a certain distance
					if v3 == nil then
						v3 = p.Parent
						v4 = Magnitude
						v5.Adornee = v3
						v5.Enabled = true
						v5.ClosestPart.Value = v3
					
						Sound1()
					elseif v3 ~= nil and v3 ~= p then
						if Magnitude < v4 then
							v3 = nil
							v4 = nil
							v5.Enabled = false
							wait(0.025)
							v3 = p.Parent
							v4 = Magnitude
							v5.Adornee = v3
							v5.Enabled = true
							v5.ClosestPart.Value = v3
						
						end
					end					
				elseif Magnitude >= 5 or Magnitude >= v4 then
					if p.Parent == v3 then
						DSize()
						wait(.1)
						v3 = nil
						v5.Adornee = nil
						v5.Enabled = false
						v5.ClosestPart.Value = nil
			
						Sound2()
					elseif v3 == nil then
						v4 = nil
						v5.Adornee = nil
						v5.Enabled = false
						v5.ClosestPart.Value = nil
			
					end
				end
			end
		end





	else
		if game:IsLoaded() then
			v3 = nil
			v5.Adornee = nil
			v5.ClosestPart.Value = nil

			v5.Enabled = false
			v4 = nil
		end
	end


until script.Disabled == true

What’s happening:
(Look at the text bellow the E)

This code looks like it’s been decompiled through Synapse. Also you could just do ,

			if p.Name == "EPart" then
				if p.Parent.Name == "NPC" then -- were i change the text!
					v5.Action.Text = "Talk"
				end

				if p.Parent.Name == "Box" then
					v5.Action.Text = "Search Box"
				end

				if p.Parent.Name == "Crate" then
					v5.Action.Text = "Search Crate"
				end

Perhaps the issue is that the parent of the part is not named “NPC”

why do you think it was decompiled through Synapse?

The variables, v1, v2, etc. Not really common to see them used in coding, mostly seen through decompiling.

the code still switches between text though

You could try doing an elseif statement, but there’s not much I can do without seeing how it’s setup for myself.

I learned to script from my friend so, I’ve just used that. Should change it to normal variables?

It’s fine, it’s really up to you, I just speak my mind quite often, so I had to say something. Though you code however you’d like to, whatever makes you feel comfortable.