Quite a few bugs in this code. On line 6 your While loop has no wait() in it, this will cause this script to hang and error out also some formatting in your text string is malformed.
This is the correct code that should run:
local t = script.Parent
local plr = t.Parent.Parent.Parent
plr:WaitForChild("stats")
local l = plr.leaderstats.level
local e = plr.stats.exp
while wait() do
t.Text = "Level "..tostring(l.Value)..": "..tostring(e.Value).."/50"
end
Also the error is erroring out with a Number value because you're trying to join a string and a number together to form a string. The above example should sort this out!
EG:
local v = "some text ["..( 1 ).. "] woot!"
this would be ok with code but Text fields in guis only accept strings(text) so to help thi compute i would change this to...
local v = "some text ["..tostring( 1 ).. "] woot!"
Hope this helps! :)
2 comments
accidently posted it on alt standingmcdonalds is my main for when I reply
try t.Text = "Level "..l.Value..": "..e.Value.."/50"