|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 01 Aug 2011 11:37 AM |
| D: I feel really dumb right now. |
|
|
| Report Abuse |
|
|