|
| 30 May 2014 08:12 PM |
I am pretty sure there is a way to transfer an object to one place to another, I could use a little help on this certain objective.
instance.new = "ScreenGui"
Can I transfer "ScreenGui" to the StarterGui service?? |
|
|
| Report Abuse |
|
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 30 May 2014 08:16 PM |
If you mean parenting then
Instance.new("ScreenGui", game.StarterGui) |
|
|
| Report Abuse |
|
|
Vaulcus
|
  |
| Joined: 06 Nov 2012 |
| Total Posts: 380 |
|
|
| 30 May 2014 08:16 PM |
Instance.new("ScreenGui", game.StarterGui)
Automatically spawns it in 'StarterGui'. Why would you need this though? Why not spawn it in the player's 'PlayerGui'? |
|
|
| Report Abuse |
|
|
|
| 30 May 2014 08:19 PM |
| I am currently learning to script and decieded to make a screen gui on death script.' |
|
|
| Report Abuse |
|
|
Vaulcus
|
  |
| Joined: 06 Nov 2012 |
| Total Posts: 380 |
|
|
| 30 May 2014 08:21 PM |
| Yeah, you use 'PlayerGui', not StarterGui... Basically when a player joins, the contents of StarterGui is copied into the player's PlayerGui. Each player does not have an individual StarterGui, so adding something to StarterGui won't affect the player. You must add the object to the players PlayerGui. |
|
|
| Report Abuse |
|
|
|
| 30 May 2014 08:23 PM |
| Alright, is PlayerGui a service or must I add a certain address or parent to send it there? |
|
|
| Report Abuse |
|
|
lupine
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 3561 |
|
|
| 30 May 2014 08:28 PM |
| PlayerGui is an object and is a direct descendant of a Player. |
|
|
| Report Abuse |
|
|
|
| 30 May 2014 08:33 PM |
function(OnDeath) if PlayerHealth = 0 then
Instance.new("ScreenGui",game.PlayerGui) Instance.new("TextBox",game.PlayerGui.ScreenGui) end
I believe this would be wrong as I am a beginner. But it was a longshot and tried it.Would this script send a ScreenGui to the player on death? |
|
|
| Report Abuse |
|
|
|
| 30 May 2014 08:36 PM |
Or....
sp = PlayerHealth
function(sp) if PlayerHealth.FindFirstChild = 0 then
Instance.new("ScreenGui",game.PlayerGui) Instance.new("TextBox",game.PlayerGui.ScreenGui) end
|
|
|
| Report Abuse |
|
|
Vaulcus
|
  |
| Joined: 06 Nov 2012 |
| Total Posts: 380 |
|
|
| 30 May 2014 11:25 PM |
This script is not tested, but it should work:
game.Players.PlayerAdded:connect(function(player) player.Character:WaitForChild("Humanoid").Died:connect(function() screen = Instance.new("ScreenGui",game.PlayerGui) text = Instance.new("TextLabel",screen) text.BorderSizePixel = 0 text.Position = UDim2.new(0,10,0,10) text.Size = UDim2.new(0,100,0,50) text.Text = "You've died!" end) end)
Oh, and BTW I see you've used 'TextBox'. A TextBox is an input field, so players can WRITE in a TextBox. What you're looking for is a TextLabel, which is something you write out yourself.
|
|
|
| Report Abuse |
|
|
Vaulcus
|
  |
| Joined: 06 Nov 2012 |
| Total Posts: 380 |
|
|
| 30 May 2014 11:27 PM |
Scratch that I forgot to fix one of your lines. Here's the script you should use:
game.Players.PlayerAdded:connect(function(player) player.Character:WaitForChild("Humanoid").Died:connect(function() screen = Instance.new("ScreenGui",player.PlayerGui) text = Instance.new("TextLabel",screen) text.BorderSizePixel = 0 text.Position = UDim2.new(0,10,0,10) text.Size = UDim2.new(0,100,0,50) text.Text = "You've died!" end) end) |
|
|
| Report Abuse |
|
|