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

Creating something in the LocalPlayer's PlayerGui?

Asked by
emite1000 335 Moderation Voter
10 years ago

I want to create a TextBox inside a Screengui that I have in the Player's PlayerGui. However, when I run this LocalScript:

Sgui = game.Players.LocalPlayer.PlayerGui.Chat
Txt = Instance.new("TextBox", Sgui)

Noting happens. I had a similar problem to this earlier, and I was advised to use a Script instead of a LocalScript (although I'm not sure why), and it worked. But this time I can't use a normal script because I don't know how to reference the correct Player without using LocalPlayer.

So what is wrong and what do I do?

0
When is this supposed to run? When the game starts? TheStudentPilot 75 — 10y
0
You need to sent the position and size of the textbox. ObscureEntity 294 — 10y
0
This script is disabled and another script un-disables it. I don't need to set the size and position to make it create in the player's GUI. emite1000 335 — 10y

1 answer

Log in to vote
-1
Answered by 10 years ago

--[[LOCALSCRIPT]]--

local localplayer=game:GetService('Players').LocalPlayer
local playergui=localplayer:findFirstChild('PlayerGui')

--Boom Gui Done. THUMBS UP! ;D

Ad

Answer this question