Answered by
7 years ago Edited 7 years ago
Here I got something for you that my help...
Don't ask me why I spent my time making this. xD
I didn't have enought space to make everything look clean at the website, so evereywhere I put "--Here" means you got to bind together the text at the second line.
I hope you understand some stuff that is in this thing. :D
01 | script.Parent.Touched:connect( function (hit) |
02 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
03 | if hit.Parent:FindFirstChild( "OverHead" ) = = nil then |
04 | local player = hit.Parent |
05 | local brickOverHead = Instance.new( "Part" , player) |
06 | local guiOverHead = Instance.new( "SurfaceGui" , brickOverHead) |
07 | local nameOverHead = Instance.new( "TextBox" , guiOverHead) |
09 | brickOverHead.Name = ( "OverHead" ) |
10 | brickOverHead.Anchored = true |
11 | brickOverHead.Transparency = 1 |
12 | brickOverHead.CanCollide = false |
14 | guiOverHead.Face = ( "Front" ) |
16 | nameOverHead.Size = UDim 2. new( 0 , 800 , 0 , 800 ) |
17 | nameOverHead.BackgroundTransparency = 1 |
18 | nameOverHead.Text = (player.Name) |
19 | nameOverHead.Font = ( "Cartoon" ) |
20 | nameOverHead.TextColor 3 = Color 3. new( 255 , 0 , 0 ) |
21 | nameOverHead.TextSize = 100 |
24 | brickOverHead.CFrame = CFrame.new(player.Torso.Position) |
25 | brickOverHead.Position = |
27 | hit.Parent:FindFirstChild( "Head" ).Position |
29 | + Vector 3. new( 0 , 3 , 0 ) |
30 | brickOverHead.Rotation = player.Torso.Rotation |
My suggestion to you is to go through all the code and figure out what's happening. :D
This may help you understand more of the code and more of scripting in roblox.
I went the loooong way and made everything out of a script. The easiest way may be to make the SurfaceGUI with the text label ready and jut clone it into a character.
Good luck with scripting!
~ TheWaterFoox