Could someone please help with my overhead script

local check = game.ServerStorage:WaitForChild(“BillboardGui”):Clone()
clone = game.ServerStorage:FindFirstChild(“BillboardGui”):Clone()

game:GetService(“Players”).PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Character)
local clonedgui = clone
clonedgui.Parent = Character.Head

	local statss = player:FindFirstChild("leaderstats")
	local spree2 = statss.Spree.Value







		local spree = statss.Spree
		spree.Changed:Connect(function(NewValue)
			
		


	
		


	
		
		
		clonedgui.SpreeTag.Text = "☠️Spree|".. spree.Value or NewValue
			clonedgui.SpreeTag.TextColor3 = Color3.fromRGB(231,206,12)
		clonedgui.SpreeTag.TextTransparency = 1
		
		


	
		
				if spree.Value >= 3 or spree.Value == 3 then
					
					
						clonedgui.SpreeTag.Text = "☠️Spree|".. spree.Value or NewValue
					clonedgui.SpreeTag.TextTransparency = 0

				end
			
	end)

end)
end)

so my problem is that the gui won’t go over the correct players head the player who actually gets the 3 spree isn’t actually getting their gui over their head its on the opponent instead. it works right once and then stops after you with the overhead gui dies i can’t code this part of the code i have no idea how at all i’m really new

You can fix this by setting the BillBoardGui Adornee to the Players Head. Just a note: why are you cloning the BillBoardGui twice?

what you mean? it does go overhead just not the right player. players head? what you mean and what’s adornee i heard that before but i don’t understand what it means

clone.Parent = Character
clone.Adornee = Character.Head

i’m not trying to clone twice i didn’t realize i was twice i know i had trouble making it clone just once so i tried making my own way for it. i ohh yea i added it twice to mess around with it cause i had that issue with cloning. kept spamming if i made code keep running. it’ll only go over players head once and it’ll stop once either die. so i gotta add it once they get a spree 3

that made it just work once. it won’t work anymore after i die. once i get the overhead gui and then i die it just stops and won’t do it anymore?

local check = game.ServerStorage:WaitForChild(“BillboardGui”):Clone()
clone = game.ServerStorage:FindFirstChild(“BillboardGui”):Clone()

game:GetService(“Players”).PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Character)

	local statss = player:FindFirstChild("leaderstats")
	local spree2 = statss.Spree.Value







	local spree = statss.Spree
	spree.Changed:Connect(function(NewValue)


		local clonedgui = clone








		






		if spree.Value >= 3 or spree.Value == 3 then
			
			
			
			clone.Parent = Character
			clone.Adornee = Character.Head
			
			clonedgui.SpreeTag.Text = "☠️Spree|".. spree.Value or NewValue
			clonedgui.SpreeTag.TextColor3 = Color3.fromRGB(231,206,12)


			clonedgui.SpreeTag.Text = "☠️Spree|".. spree.Value or NewValue
			clonedgui.SpreeTag.TextTransparency = 0

		end

	end)

end)

end)

I cleaned up a bit your code so it would not look that messy. I haven’t found anything wrong with it expect for this line if spree.Value >= 3 or spree.Value == 3 then; there is no need to double check if spree is equal to 3 since >= already does it. To remove the gui from the head when the values is less than 3 your could add an else inside the if statement.

local clone = game.ServerStorage:WaitForChild(“BillboardGui”):Clone()

game:GetService(“Players”).PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Character)
local statss = player:FindFirstChild("leaderstats")
	local spree2 = statss.Spree.Value
	local spree = statss.Spree
	spree.Changed:Connect(function(NewValue)
		if spree.Value >= 3 then
			clone.Parent = Character
			clone.Adornee = Character.Head		
			clonedgui.SpreeTag.Text = "☠️Spree|".. spree.Value or NewValue
			clonedgui.SpreeTag.TextColor3 = Color3.fromRGB(231,206,12)
			clonedgui.SpreeTag.Text = "☠️Spree|".. spree.Value or NewValue
			clonedgui.SpreeTag.TextTransparency = 0
		end
	end)
end)
2 Likes

honestly i made another post with a different ish issue with it. i got it all working and only issue i had was the gui would remove itself and not work anymore after you die like if i had 3 spree overhead and then i die then it stops working and no longer does it and i think it also wasn’t putting the spree over the right player too. but someone helped me fix the code completely and exactly how i want it so i’m good now. but regardless thank you so much for even trying and even going through with it at all really appreciate it.

also thx for making it less messy too lol someone like legit 2 people on other post were just complaining about how the code was, and wasn’t even helpful.

I hope you will find a solution for your new problem. If this helped you, please mark it as solved. Have a nice day!