This is the error that comes when I run the script: Players.Player.PlayerGui.ScreenGui.TextBox.Script:5: attempt to concatenate global 'Power' (a userdata value)
this script is a child of a textbox.
Player = script.Parent.Parent.Parent.Parent Char = Player.Character Power = Player:WaitForChild("Power") script.Parent.Text = "Energy: " .. Power
I believe it is because setting the text of anything requires a string, and it can't find one from that. If it is a StringValue, do this:
script.Parent.Text = "Energy: " .. Power.Value
Otherwise if it is another Gui, do this:
script.Parent.Text = "Energy: " .. Power.Text
Please use LocalScripts for GUI and anything that is for the player only. This will fix it:
local player = game.Players.LocalPlayer -- You can get the player easily in localscripts local power = player:WaitForChild("Power") script.Parent.Text = power.Value -- Power itself is not a value (it's an object) therefore we need to set it to a property of the object.