Hello!
I am trying to manipulate the text in my ROBLOX UI in Game as follows
Take the username clydedbeast647
I want the script to display on the textlabel: clyded********
Here is my code:
local Username = game.Players.LocalPlayer.Name local Filter = '*' local ExpandTo = (#Username >= 5 and math.random(3,#Username-1) or 3) local Result = Username:sub(1,ExpandTo)..Filter:rep(7) script.Parent.Text = "Welcome back " .. Result
It keeps producing a random amount of *, I don't know how to fix it.
local Username = game.Players.LocalPlayer.Name local Filter = '*' local rand if #Username-1 > 3 and #Username >= 5 then rand = math.random(3,#Username-1) else rand = 3 end local ExpandTo = rand local Result = Username:sub(1,ExpandTo)..Filter:rep(#Username-ExpandTo) script.Parent.Text = "Welcome back " .. Result
Fixed it, further details are on Wiki