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

Custom Number SurfaceGUI on Player?

So I have this script that allows a person to have their username on the back of their torso, is their a way where you could be able to add a number like (00 or 32), it's like a Jersey Script, for my game. (Sports-Related)

wait(5)
local plr=game.Players.LocalPlayer
local surf=Instance.new('SurfaceGui',plr.Character:WaitForChild'Torso')
surf.Adornee=plr.Character.Torso
surf.Face='Back'
surf.CanvasSize=Vector2.new(100,100)
local txt=Instance.new("TextLabel",surf)
txt.BackgroundTransparency=1
txt.TextStrokeTransparency=0
txt.TextColor3=Color3.new(1,1,1)
txt.Text=plr.Name
txt.Size=UDim2.new(1,0,0.5,0)
txt.Position=UDim2.new(0,0,0,0)
txt.FontSize=Enum.FontSize.Size12
txt.TextScaled=false
txt.TextWrapped=true

I'm just wondering, am I able to use this script in order to add like a custom number for them? Like it has their username on the back, plus a custom number they can choose from 0-99. If its also possible is there a way to change the username to a custom name on the back as well?

Thanks, LukeGabrieI

1 answer

✓ Accepted answer

You will have to setup an outside value for the number. Make some type of input change it, then you can simply concatenate the Player's name with the value.

--This is your value that will be edited
local val = script.Parent.Parent.Numbers

-- [code]

txt.Text = plr.Name.." "..tostring(val.Value)

2 comments

0

Would you be able to help me with the input change lol

1

Use a TextBox. They have an event called FocusLost that will tell you when someone started typing and hit enter. Have this event manipulate the same value that the code above is referencing.

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