|
| 11 Jun 2012 08:40 PM |
I'm trying to create a GUI when a player enters a game, and I need a little help on how to properly set the position and size of the created GUI.
|
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 08:42 PM |
wiki.roblox.com
~thedestroyer115, remove the FPS plug-in. Save ROBLOX 2012~
|
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 08:53 PM |
I didn't come here for a link to the Roblox Wiki, do you think I would've came here if I didn't need the help?
I come here because up til now, I've encountered nothing but helpful, kind people willing to help me and many others out.
So if your idea of being a "Scripting Helper" is posting a link to the Wiki, you can leave.
|
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 08:54 PM |
Hm, wouldn't it be easier to just clone the GUI from the script to the players, instead of creating it through code?
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 08:58 PM |
| I have the whole GUI set up and saved as a model, and if I knew how to do that, I would :/ |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:06 PM |
Put the GUI inside the script.
local GUI = "NAMEOFGUI" --Change the name to what it's called.
Game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:wait() script[GUI]:Clone().Parent = p.PlayerGui end)
† KMXD † |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 11 Jun 2012 09:08 PM |
| Couldn't you just put it in the starter gui? |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:09 PM |
@kill
Right, but I assumed he would want it to do it once.
† KMXD † |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 11 Jun 2012 09:11 PM |
| Oh so startergui opens up again each time you respawn? |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:12 PM |
I only want it to appear on specified player's screens, not all.
Would I just put it in PlayerGUI then? |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:13 PM |
It would show up every time you spawn, yes.
† KMXD † |
|
|
| Report Abuse |
|
|
| |
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 11 Jun 2012 09:14 PM |
| Yes you wouldd put it in the specified players' playergui's. So, do you need help sizing and positioning? |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:15 PM |
@mad
Like:
local GUI = "NAMEOFGUI" --Change the name to what it's called. Game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:wait() if p.Name == "MadDog7736" then script[GUI]:Clone().Parent = p.PlayerGui end end)
?
† KMXD † |
|
|
| Report Abuse |
|
|
thane1326
|
  |
| Joined: 08 Apr 2009 |
| Total Posts: 867 |
|
|
| 11 Jun 2012 09:19 PM |
| Frame.Size = UDim2.new(0, 10, 0, 10) |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:19 PM |
| Yes Knight, but how does the script know which GUI to use just by the name, do I keep the GUI in Lighting, or Workspace? |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 11 Jun 2012 09:19 PM |
| I'm guessing since there are specified players, then there is specified times, unless it is like admin something. |
|
|
| Report Abuse |
|
|
thane1326
|
  |
| Joined: 08 Apr 2009 |
| Total Posts: 867 |
|
|
| 11 Jun 2012 09:20 PM |
| Oh, oops, only read the name. |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 11 Jun 2012 09:20 PM |
| Don't put it in workspace, or else everyone will see it. Keep it in lighting until you want to use it, then just clone it and put it in the specific player's playergui |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:20 PM |
Put the GUI inside the script. Though this will only show once.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:21 PM |
function onPlayerEntered(p)
if p.AccountAge < 1000 then repeat wait() until p.Character p.Character.Head.Anchored = true p.CameraMode = "LockFirstPerson"
block = Instance.new("ScreenGui") black = Instance.new("Frame") sorry = Instance.new("ImageLabel")
black.BackgroundColor3 = BrickColor.new('Really Black') black.BorderColor3 = BrickColor.new('Really Black') black.Position = UDim2.new(0, -500, 0, -500) black.Size = UDim2.new(20, 200, 20, 200) black.Visible = true
sorry.Image = "http://www.roblox.com/asset/?id=83337603" sorry.Position = UDim2.new(0, 525, 0, 100) sorry.Size = UDim2.new(0, 300, 0, 300) sorry.Visible = true
end end
game.Players.PlayerAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:21 PM |
That is what I have so far.
@Knight, that is fine, it will only need to show once. |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 11 Jun 2012 09:22 PM |
| Make the frame and image label children of the screen gui |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:24 PM |
They are killjoy.
And Knight, your post helped so much, it works now.
Now if the player entered has an account made after the specified date, they receive the GUI, thank you very much guys, all so helpful. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2012 09:25 PM |
No problem, glad to help.
† KMXD † |
|
|
| Report Abuse |
|
|