|
| 12 Apr 2015 05:41 PM |
Output Error = Workspace.Message Script:6: attempt to index global 'Player' (a nil value)
Player = game.Players.LocalPlayer
local ScreenGui = Instance.new("ScreenGui", game.StarterGui) local Frame = Instance.new("Frame", game.StarterGui.ScreenGui) local TextLabel = Instance.new("TextLabel", game.StarterGui.ScreenGui.Frame) ScreenGui.Parent = Player.PlayerGui Frame.Size = UDim2.new(0,0,0,0) TextLabel.Size = UDim2.new(0,1375,0,50) Frame.Position = UDim2.new(0,0,0,0) TextLabel.Position = UDim2.new(0,1,0,1) TextLabel.TextColor3 = Color3.new(0/255, 0/255, 255/255) TextLabel.BackgroundTransparency = 0.85 TextLabel.BackgroundColor3 = Color3.new(0/255, 0/255, 0/255) TextLabel.Font = "ArialBold" TextLabel.TextScaled = true
Sad For My Sad |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 12 Apr 2015 05:53 PM |
repeat wait() until game.Players.LocalPlayer;
Also 0/255 :c |
|
|
| Report Abuse |
|
|
CscLambda
|
  |
| Joined: 09 Nov 2014 |
| Total Posts: 46 |
|
|
| 12 Apr 2015 05:54 PM |
.... TextLabel.TextColor3 = Color3.new(0, 0, 1) TextLabel.BackgroundTransparency = 0.85 TextLabel.BackgroundColor3 = Color3.new(0, 0, 0) ....
FTFY |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:01 PM |
@e where do I put that. Why not just fix it.
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:02 PM |
LocalPlayer can't be indexed if you are using a server script.
|
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:04 PM |
just like clone said, LocalPlayer can't be used in ServerScripts, and it couldn't error in a LocalScript, cos it is only Replicated to the Client (and Starts) when the Client itself Starts (Obviously) so then LocalPlayer could be used...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:12 PM |
Localscripts don't create instances though.
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:13 PM |
what u mean? 'Localscripts don't create instances though'
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:15 PM |
LocalScripts can make instances just fine.
|
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:16 PM |
Someone last night told me that. So where do I place the localscript, and what goes with what
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:19 PM |
What's wrong with this then?
game.Players.PlayerAdded:connect(function(player) if game.Players.NumPlayers < 2 then game.Workspace.GameScript.Disabled = true game.player.PlayerGui.ScreenGui.Frame.TextLabel.Text = "Hello, "..player.Name.. ", welcome to Laser Tag 0.3.0, unfortunately, this game has a limit for players, so please invite a friend!" elseif game.Players.NumPlayers >= 2 then game.player.PlayerGui.ScreenGui.Frame.TextLabel.Text = "There are now 2 players, rounds are starting soon!" wait(5) game.Workspace.GameScript.Disabled = false game.StarterGui.ScreenGui:Destroy() end end)
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:20 PM |
Instead of having the server change the gui, have a StringValue called InfoReel or something, and have a localscript in the client which reflects what the value of the InfoReel is.
|
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:22 PM |
^
Aha! I knew it wasn't a bad idea. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:22 PM |
How do I do that. I never work with values. *Face-Palm*
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:23 PM |
local h = workspace:WaitForChild("InfoReel")
function updateGui() script.Parent.TextLabel.Text = h.Value end
updateGui() h.Changed:connect(updateGui) |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:23 PM |
And also, what localscript, what is in it, how do I put it in client, what are you talking about.
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:24 PM |
Instead of having the script create the gui, just have it premade in the StarterGui. I don't even know why you are making it with scripts to begin with.
Insert a LocalScript into the Frame, and paste the script I just posted above.
|
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:28 PM |
How do I still get the ..player.Name.. then?
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:29 PM |
| If its in a LocalScript, you can use game.Players.LocalPlayer.Name |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:32 PM |
Where do I put that.
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:33 PM |
What do I put in the value?
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:34 PM |
Oh wait, now I see. Here's a neat trick you can do.
Make it so the game sets the message to something like "Hello PLAYERNAME!"
Then use this line instead
script.Parent.TextLabel.Text = string.gsub(h.Value,"PLAYERNAME",game.Players.LocalPlayer.Name) |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:35 PM |
@Surface Whatever you want. It acts as a global message system.
|
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:36 PM |
I put it in workspace, and it says h is unknown.
Sad For My Sad |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 06:37 PM |
h = workspace:WaitForChild("InfoReel")
Add that to the top of the script :P
|
|
|
| Report Abuse |
|
|