generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Is there a possible way to..

Previous Thread :: Next Thread 
C0ldDeath is not online. C0ldDeath
Joined: 18 Mar 2014
Total Posts: 7
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 is not online. 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 is not online. 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
C0ldDeath is not online. C0ldDeath
Joined: 18 Mar 2014
Total Posts: 7
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 is not online. 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
C0ldDeath is not online. C0ldDeath
Joined: 18 Mar 2014
Total Posts: 7
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 is not online. 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
C0ldDeath is not online. C0ldDeath
Joined: 18 Mar 2014
Total Posts: 7
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
C0ldDeath is not online. C0ldDeath
Joined: 18 Mar 2014
Total Posts: 7
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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image