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

Changing overhead Gui through leaderstats?

I'm not sure why this is proving so difficult, but I have a leaderstats script that works as well as an overhead gui script which works. I would like to change the overhead gui text, based on the leaderstat value of the player ie - a title/rank system. Could I not just add an "if" statement at line 3 that checks for the players leaderstats.Money.Value? Something that would end like Money.Value >= 2000 then...? Thanks. This has been my Achilles Heel lately.

game.Players.PlayerAdded:Connect(onPlayerRespawned)
function onPlayerRespawned(newPlayer)
		
		wait(1)
		local gui=Instance.new("BillboardGui")
		gui.Parent=newPlayer.Character.Head
		gui.Adornee=newPlayer.Character.Head
		gui.Size=UDim2.new(3,0,4,0) 
		gui.StudsOffset=Vector3.new(0,1,0)
		local name=Instance.new("TextLabel")
		name.Parent = gui
		name.BackgroundTransparency = 1
		name.Text = "Noob"  
		name.Size = UDim2.new(1,0,1,0)
		name.Position=UDim2.new(0,0,-0.41,0)
		name.TextColor3=Color3.new(255,255,255)
		name.FontSize = "Size18"
		end
		
function onPlayerEntered(newPlayer)
	newPlayer.Changed:Connect(function (property)
		if (property == "Character") then
			onPlayerRespawned(newPlayer)
		end
	end)
end

game.Players.PlayerAdded:Connect(onPlayerEntered)

2 comments

0

You should be using local functions, and instead of changed simply wait for the character.

0

Ok, I will change to CharacterAdded

2 answers

If you respond to my DMs, I can help you. (This reply contains a quick screenshot of what I've sent you)

https://imgur.com/a/U139632

Response will be edited with final solution.

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