|
| 29 Mar 2014 08:43 PM |
This is supposed to make a GUI pop up when you collide with a certain part.
function onTouched(part) if part.Parent then local h = part.Parent:FindFirstChild("Humanoid") if h then game.ServerStorage.Checking:Clone() .Parent = h.PlayerGUI() end end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2014 08:47 PM |
.PlayerGUI()
that's not how you get PlayerGui |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2014 08:51 PM |
..Omg, people can't script for their lives today.. Try this: function onTouched(hit) if hit.Parent:FindFirstChild("Humanoid") then check=game.ServerStorage.Checking:clone() plrgui=game.Players:PlayerFromCharacter(hit.Parent).PlayerGui check.Parent=plrgui end end script.Parent:connect(onTouched) |
|
|
| Report Abuse |
|
|
Rapster2
|
  |
| Joined: 16 Oct 2009 |
| Total Posts: 1865 |
|
|
| 29 Mar 2014 08:57 PM |
You need to use:
game:GetService("ServerStorage")
in order to get it.
You also need the Player, not just the character.
Here's my version:
function onTouched(hit) if hit.Parent:FindFirstChild("Humanoid") then local storage = game:GetService("ServerStorage") local plyr = game.Players:GetPlayerFromCharacter(hit.Parent) storage.Checking:Clone().Parent = plyr.PlayerGui end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|