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

why does it not change the text when the value is changed?

local leaderstats = game.Players.LocalPlayer.leaderstats
local level = leaderstats.Level
local exp = level:WaitForChild("EXP") 
local levelDisplay = script.Parent.Level
local expDisplay = script.Parent.Exp

exp.Changed:Connect(function()
expDisplay.Text = "Exp: "..exp.Value "/1000"	
end)
level.Changed:Connect(function()
	levelDisplay.Text = "level: "..level.Value	
end)

changing the level works but not the exp i get an error Error attempt to call field 'Value' (a number value)

local script in a screenGUI

2 answers

✓ Accepted answer

You're gonna hate yourself for this, but you missed the concatenation ".." here:

expDisplay.Text = "Exp: "..exp.Value.. "/1000"

4 comments

0

oh i didnt know you needed it on both ends

0

ive never done it with text on both ends

0

Yup, any time you connect strings together, you'll need it in between.

0

ok thx

Try this:

local Player = game.Players.LocalPlayer
repeat wait() until Player.leaderstats
local leaderstats = Player.leaderstats

2 comments

0

it can get leaderstats it just cant change the exp display to exp value

0

lol you didn't seem to even read the question, someone answered above you, look at the question carefully and at the answer.

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