Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
|
| 29 Nov 2013 07:48 PM |
Okay, I'm trying to make it so it so I don't have to use the "Hint" and "Message" talk they have, I want a GUI. But I don't know were my problem is.
1st
local Player = game.Players:GetPlayers().PlayerGui local a = Instance.new("ScreenGui") local b = Instance.new("Frame") local c = Instance.new("TextLabel") b.Parent = a b.BackgroundColor3 = Color3.new(0/255,0/255,0/255) b.Position = UDim2.new(0,0,0,0) b.Size = UDim2.new(1,0,0.1,0) b.BackgroundTransparency = 1 c.Font = "ArialBold" c.FontSize = "Size24" c.Parent = b c.BackgroundTransparency = 1 c.TextTransparency = 1 c.TextColor3 = Color3.new(255/255,255/255,255/255) c.Size = UDim2.new(1,0,1,0) c.Text = "Welcome" a.Parent = Player
2nd
local Player = game.Players.LocalPlayer local Local = Player.PlayerGui local a = Instance.new("ScreenGui") local b = Instance.new("Frame") local c = Instance.new("TextLabel") b.Parent = a b.BackgroundColor3 = Color3.new(0/255,0/255,0/255) b.Position = UDim2.new(0,0,0,0) b.Size = UDim2.new(1,0,0.1,0) b.BackgroundTransparency = 1 c.Font = "ArialBold" c.FontSize = "Size24" c.Parent = b c.BackgroundTransparency = 1 c.TextTransparency = 1 c.TextColor3 = Color3.new(255/255,255/255,255/255) c.Size = UDim2.new(1,0,1,0) c.Text = "Welcome" a.Parent = Local
Thanks so much for reading, and replying! |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 07:52 PM |
Wait, you're using both or just one? Why are there two scripts?
First thing I noticed: local Player = game.Players:GetPlayers().PlayerGui --can't do that |
|
|
| Report Abuse |
|
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
|
| 29 Nov 2013 07:53 PM |
| If you read, I said 1st one is the one that is not working and second is the one that works in Play Solo mode... and yes I understand that does not work. But what can I do to make it work? |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 07:55 PM |
for i,v in pairs(game.Players:GetPlayers()) do local a = Instance.new("ScreenGui", v) local b = Instance.new("Frame", a) local c = Instance.new("TextLabel", b) b.BackgroundColor3 = Color3.new(0/255,0/255,0/255) b.Position = UDim2.new(0,0,0,0) b.Size = UDim2.new(1,0,0.1,0) b.BackgroundTransparency = 1 c.Font = "ArialBold" c.FontSize = "Size24" c.BackgroundTransparency = 1 c.TextTransparency = 1 c.TextColor3 = Color3.new(255/255,255/255,255/255) c.Size = UDim2.new(1,0,1,0) c.Text = "Welcome" end
|
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 07:55 PM |
--edit
local a = Instance.new("ScreenGui", v.PlayerGui)
|
|
|
| Report Abuse |
|
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
|
| 29 Nov 2013 08:03 PM |
What you added is great! But, I should have added this because it is not working:
while true do for i,v in pairs(game.Players:GetPlayers()) do local a = Instance.new("ScreenGui", v.PlayerGui) local b = Instance.new("Frame", a) local c = Instance.new("TextLabel", b) b.BackgroundColor3 = Color3.new(0/255,0/255,0/255) b.Position = UDim2.new(0,0,0,0) b.Size = UDim2.new(1,0,0.1,0) b.BackgroundTransparency = 1 c.Font = "ArialBold" c.FontSize = "Size24" c.BackgroundTransparency = 1 c.TextTransparency = 1 c.TextColor3 = Color3.new(255/255,255/255,255/255) c.Size = UDim2.new(1,0,1,0) c.Text = "Welcome" end c.TextTransparency = 0.9 wait(.01)
Do you think the while true statement is confusing my script?
|
|
|
| Report Abuse |
|
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
| |
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
| |
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
| |
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
|
| 29 Nov 2013 08:13 PM |
Okay, so I have two parts where it goes for i,v stuff like that here
local m = math.random(1,Games) local player = game.Players:GetPlayers() for i = 1, #player do if m == 1 then
can that ruin the script? |
|
|
| Report Abuse |
|
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 08:19 PM |
| While true do is going to keep inserting the GUI over an over forever. |
|
|
| Report Abuse |
|
|
Shonysky
|
  |
| Joined: 05 Aug 2013 |
| Total Posts: 361 |
|
|
| 29 Nov 2013 08:19 PM |
| you need a connection to do that |
|
|
| Report Abuse |
|
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
|
| 29 Nov 2013 08:21 PM |
I know that. I just don't get why it is working. I see what your saying it's not while true. But here because i thinkg their is a problem sense i have these two connection going on:
local m = math.random(1,Games) local player = game.Players:GetPlayers() for i = 1, #player do -- should i change the "i"? if m == 1 then
while true do for i,v in pairs(game.Players:GetPlayers()) do local a = Instance.new("ScreenGui", v.PlayerGui) local b = Instance.new("Frame", a) local c = Instance.new("TextLabel", b) b.BackgroundColor3 = Color3.new(0/255,0/255,0/255) b.Position = UDim2.new(0,0,0,0) b.Size = UDim2.new(1,0,0.1,0) b.BackgroundTransparency = 1 c.Font = "ArialBold" c.FontSize = "Size24" c.BackgroundTransparency = 1 c.TextTransparency = 1 c.TextColor3 = Color3.new(255/255,255/255,255/255) c.Size = UDim2.new(1,0,1,0) c.Text = "" end |
|
|
| Report Abuse |
|
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
|
| 29 Nov 2013 08:24 PM |
| @Shonysky, i have a connection. It's just the single part I requested help for. |
|
|
| Report Abuse |
|
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 08:30 PM |
I don't know what you're trying to do, mini games? Here are some options;
local Games = game.Lighting.Games:GetChildren() --Change, idk your directory. local m = Games[math.random(1, #Games)] local player = game.Players:GetPlayers() local hint = Instance.new("Hint", Workspace) local mini = 2 --minimum players to start local gameStarted = false
function chooseMap() return Games[math.random(1, #Games)] end
function gui() for i,v in pairs(game.Players:GetPlayers()) do local a = Instance.new("ScreenGui", v.PlayerGui) local b = Instance.new("Frame", a) local c = Instance.new("TextLabel", b) b.BackgroundColor3 = Color3.new(0/255,0/255,0/255) b.Position = UDim2.new(0,0,0,0) b.Size = UDim2.new(1,0,0.1,0) b.BackgroundTransparency = 1 c.Font = "ArialBold" c.FontSize = "Size24" c.BackgroundTransparency = 1 c.TextTransparency = 1 c.TextColor3 = Color3.new(255/255,255/255,255/255) c.Size = UDim2.new(1,0,1,0) c.Text = "" end end
function countdown() for i = 60, 0, -1 do hint.Text = "Game ending in " ..i wait(1) end end
function startGame() gui() local map = chooseMap() hint.Text = "Map chosen: "..map.Name countdown() gameStarted = false end
while wait() do if not gameStarted then if game.Players.NumPlayers >= mini then gameStarted = true startGame() else hint.Text = "Waiting for ".. mini - game.Players.NumPlayers.. " more player to join." end end end
|
|
|
| Report Abuse |
|
|
Airennor
|
  |
| Joined: 31 Oct 2012 |
| Total Posts: 1607 |
|
|
| 29 Nov 2013 08:32 PM |
| Yes, minigames. My minigames. But my script has 1200 lines but this one uses hints mine don't i have a countdown gui inside the script. But I'll try functions. Or something thanks for the help. |
|
|
| Report Abuse |
|
|
Shonysky
|
  |
| Joined: 05 Aug 2013 |
| Total Posts: 361 |
|
|
| 30 Nov 2013 06:22 AM |
| where is localizated the script? its need to be a script, not a local script, and need to be placed in the workspace |
|
|
| Report Abuse |
|
|