I have a Gui that is as big as the full screen and i have a frame2 that is a little smaller and i have a text label that is suppose to read the players name when they enter and say Hello 'playername' but when i add the plr function it breaks the whole gui and it's not there anymore. Please help.
--Here is my original Gui script
local screenGui=Instance.new("ScreenGui")
screenGui.Parent=script.Parent
local frame=Instance.new("Frame")
frame.Parent=screenGui
frame.Size=UDim2.new(1,0,1,0)
frame.Position=UDim2.new(0,0,0,0)
frame.BackgroundColor3 = Color3.new(0,0,0)
local frame2=Instance.new("Frame")
frame2.Parent=screenGui
frame2.Size=UDim2.new(0.9,0,0.9,0)
frame2.Position=UDim2.new(0.05,0,0.05,0)
frame2.BackgroundColor3=BrickColor.White().Color
local textLabel=Instance.new("TextLabel")
textLabel.Parent=frame2
textLabel.Position=UDim2.new(0.05,0,0.05,0)
textLabel.Size=UDim2.new(0.9,0,0.9,0)
textLabel.BackgroundColor3=BrickColor.White().Color
textLabel.Text='Hello'
This is when i add the plr function it breaks...
game.Players.PlayerAdded:connect(function(plr)
local screenGui=Instance.new("ScreenGui")
screenGui.Parent=script.Parent
local frame=Instance.new("Frame")
frame.Parent=screenGui
frame.Size=UDim2.new(1,0,1,0)
frame.Position=UDim2.new(0,0,0,0)
frame.BackgroundColor3 = Color3.new(0,0,0)
local frame2=Instance.new("Frame")
frame2.Parent=screenGui
frame2.Size=UDim2.new(0.9,0,0.9,0)
frame2.Position=UDim2.new(0.05,0,0.05,0)
frame2.BackgroundColor3=BrickColor.White().Color
local textLabel=Instance.new("TextLabel")
textLabel.Parent=frame2
textLabel.Position=UDim2.new(0.05,0,0.05,0)
textLabel.Size=UDim2.new(0.9,0,0.9,0)
textLabel.BackgroundColor3=BrickColor.White().Color
textLabel.Text=('Hello '..plr.Name)
end)

8 comments
It's still not working
Wait, what do you mean by a sever script?
Server*
A server script is the script that does not have the head in the picture of it, when you insert it, insert one called "Script" not "LocalScript", and put it under ServerScriptService
A regular script. So, a script that's not a LocalScript or ModuleScript.
Wow, thanks, But i don't understand why you would put it in a regular script because everyone say's to put Gui's in a local script inside of StarterGui
Well you only need to do that if you're using Properties or Data restricted to LocalScripts. This includes things like 'game.Players.LocalPlayer'
Ok, Thanks