Gui not showing plr's jump height

Hello roblox developer forum people! I have an issue with a gui not displaying the plr’s jump height. Here is my script:

local localPlayer = game.Players.LocalPlayer
local text = localPlayer.PlayerGui.ScreenGui["JumpPower#"].Text
local char = localPlayer.Character

while true do
	text = char.Humanoid:WaitForChild("JumpHeight")
	task.wait(1.1)
end

When debugging the script, it was successfully able to find the char and humanoid, but was NOT able to find the jumpheight property. It said Value not found while others where in the correct place. I tried char.Humanoid.JumpHeight but that didn’t work either. Anyone able to help me fix this? Thanks for your time!

Sincerely,
GummyAirplaneYT

The .Text value returns a string, you can’t just set it like that, try this:

local localPlayer = game.Players.LocalPlayer
local text = localPlayer.PlayerGui.ScreenGui["JumpPower#"]
local char = localPlayer.Character

while true do
	text.Text = char.Humanoid.JumpHeight
	task.wait(1.1)
end

When you put .Text there, it returns the raw text as is, and not as something you can change. It’s a little hard to explain, so I’ll just show it to you.

local text = textLabel.Text
-- This would return "Hello World" for the example
-- This variable is equal to
local text = "Hello World"
-- That's the same thing
-- So, setting it would just change the variable, not the actual text

-- This is how you should do it
local text = textLabel -- The TextLabel object. Now it is what we call a "reference", and not just raw data. Any changes made to this object will reflect the actual TextLabel
text.Text = "Goodbye World"  -- Changes TextLabel text to "Goodbye World"

You will have to do what @MrOnlyKemal suggested.

Oh! Thanks, that cleared things up. I’ll try it.

Well that was one problem, I found another issue but was able to resolve it. Thanks you two for your help!

Sincerely,
Lemoblox

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.