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: GUI help needed

Previous Thread :: Next Thread 
traingeek19 is not online. traingeek19
Joined: 26 Sep 2008
Total Posts: 62
01 Aug 2011 11:00 AM
I have made a very simple gui that really just gives out some info then go's away but how do i make an onTouched() script that will get the gui into the player that needs to see it?


Here is what i have so far:

local gui = script.Parent.ScreenGui

local backup = gui:clone()

function onTouched(hit)

local person = hit.Parent
if person:FindFirstChild("Humanoid") then
gui = backup:clone()
gui.Parent = -- i don't know what to put here!


end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
01 Aug 2011 11:05 AM
script.Parent.Touched:connect(onTouched)

You cant touch a GUI therefor, you cant use Touched.
The event you want is either

MouseButton1Down
MouseButton1Click
MouseButton1Up


Or for right clicks

MouseButton2Down
MouseButton2Click
MouseButton2Up
Report Abuse
traingeek19 is not online. traingeek19
Joined: 26 Sep 2008
Total Posts: 62
01 Aug 2011 11:31 AM
you don't under stand i need a script that will put a gui into a player
Report Abuse
Spectrumz is not online. Spectrumz
Joined: 22 Mar 2011
Total Posts: 4338
01 Aug 2011 11:33 AM
@giga

He means a brick that is touched that clones a GUI into the player.

And here's what you do:

local player = game.Players:GetPlayerFromCharacter(person)
if player then
GUI.Parent = player.PlayerGui
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
01 Aug 2011 11:37 AM
D: I feel really dumb right now.
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