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

Paste GUI into localplayer?

Its a level up gui that will pop up, then go nil afterwards. But it doesn't above the Local Player's Head

local player = game.Players.LocalPlayer.Character

local gui = Instance.new("BillboardGui",workspace)
	gui.Name = "LEVELUP"
	gui.Size = UDim2.new(5,0,2,0)
	gui.ExtentsOffset = Vector3.new(0,8,0)
		Instance.new("Frame",gui)
		gui.Frame.Size = UDim2.new(1,0,2,0)
		gui.Frame.BorderSizePixel = 0

local Image		= Instance.new("ImageLabel",gui.Frame)

Image.BorderSizePixel 			= 2
Image.BorderColor3				= Color3.new(20/255,20/255,20/255)
Image.Size						= UDim2.new(1,0,1,0)
Image.Image						= "rbxassetid://167251759"

local TextLabel = Instance.new("TextLabel",gui.Frame)

TextLabel.Size						= UDim2.new(1,0,1,0)
TextLabel.Font 						= "ArialBold"
TextLabel.Text						= "LEVEL UP"
TextLabel.FontSize					= Enum.FontSize.Size28
TextLabel.TextScaled				= true
TextLabel.TextWrapped				= true
TextLabel.BackgroundTransparency	= 1
TextLabel.TextStrokeColor3			= Color3.new(100/255,100/255,100/255)
TextLabel.TextStrokeTransparency	= 0
TextLabel.TextColor3				= Color3.new(255/255,200/255,50/255)
TextLabel.BorderSizePixel 			= 0

gui.Parent = player.Head

wait(5)

gui.Parent = nil

5 comments

0

Your code seemed to run fine in my testing. Are you using a LocalScript and where are you trying to run it from?

0

The script is in workspace, and its localscript

0

You have to set the GUI's Adornee!

0

A LocalScript won't run under Workspace unless it's in a character Model.

0

What is Adornees for?

1 answer

local player = game.Players.LocalPlayer.Character -- Here we got the problem.

local gui = Instance.new("BillboardGui",workspace)
    gui.Name = "LEVELUP"
    gui.Size = UDim2.new(5,0,2,0)
    gui.ExtentsOffset = Vector3.new(0,8,0)
        Instance.new("Frame",gui)
        gui.Frame.Size = UDim2.new(1,0,2,0)
        gui.Frame.BorderSizePixel = 0

local Image     = Instance.new("ImageLabel",gui.Frame)

Image.BorderSizePixel           = 2
Image.BorderColor3              = Color3.new(20/255,20/255,20/255)
Image.Size                      = UDim2.new(1,0,1,0)
Image.Image                     = "rbxassetid://167251759"

local TextLabel = Instance.new("TextLabel",gui.Frame)

TextLabel.Size                      = UDim2.new(1,0,1,0)
TextLabel.Font                      = "ArialBold"
TextLabel.Text                      = "LEVEL UP"
TextLabel.FontSize                  = Enum.FontSize.Size28
TextLabel.TextScaled                = true
TextLabel.TextWrapped               = true
TextLabel.BackgroundTransparency    = 1
TextLabel.TextStrokeColor3          = Color3.new(100/255,100/255,100/255)
TextLabel.TextStrokeTransparency    = 0
TextLabel.TextColor3                = Color3.new(255/255,200/255,50/255)
TextLabel.BorderSizePixel           = 0

gui.Parent = player.Head

wait(5)

gui.Parent = nil

If a script tries getting the LocalPlayer then it HAS to be in the player. So if this script is in workspace then the LocalPlayer will be nil, causing the rest of this script to break. Just put this entire script into StarterGui and modify it to your likings, hope this has helped.

2 comments

0

I'm actually just editing the pesky level up message u get with the rpg starter kits. So this is a script inside ServerScriptService

0

Then you'll need another way of getting the player.

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