Reputation: 91
I need to change a TextLabel text to a Player Attribute Value but i dont know how to do this. I tried to make a code:
local player = game.Players.LocalPlayer
function ChangeTextMastery()
script.Parent.Frame.CurrentMastery.Text = "Current Mastery - " .. tonumber(player:GetAttribute("Mastery"))
end
game.Players.PlayerAdded:Connect(ChangeTextMastery)
Upvotes: 0
Views: 98
Reputation: 21
Yes you must do tostring() because it only accepts strings and not integers. If you want you can also write tostring(tonumber(Player:GetAttribute("Mastery"))) but I do not think it is needed
Upvotes: -1