Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I change an OverHeadGui based on a leaderboard value?

local BillboardGui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
local ClonedGui = BillboardGui:Clone()
game.Players.PlayerAdded:Connect(function(player)
	
	player.CharacterAdded:Connect(function(character)
		if player.Name == "player" then
			
			ClonedGui.Parent = game.Workspace:WaitForChild(player.Name).Head
		end
		
		
		
		if game.leaderstats.Wins.Value == 0 then
			ClonedGui.TextLabel.Text = "Guest"
			end
	
end)
end)

leaderstats is not a valid member of DataModel

1 answer

✓ Accepted answer
local BillboardGui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
	local ClonedGui = BillboardGui:Clone()	game.Players.PlayerAdded:Connect(function(player)
	 
	    player.CharacterAdded:Connect(function(character)
	        if player.Name == "player" then
	 
	            ClonedGui.Parent = character.Head -- im pretty sure ur way also works but i prefer this
	        end
	 
	 
	 
	        if player.leaderstats.Wins.Value == 0 then --- if im right the stats were made in the player so u have to search in the player
	            ClonedGui.TextLabel.Text = "Guest"
	            end
	 
	end)
	end)

im not 100procent if it works but i think this should work

This discussion is preserved as it was. New answers, comments, and votes are closed.