Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Custom Number SurfaceGUI on Player?

Asked by 7 years ago

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

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

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)
0
Would you be able to help me with the input change lol LukeGabrieI 73 — 7y
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. Goulstem 8144 — 7y
Ad

Answer this question