|
| 19 Sep 2012 02:54 PM |
The script only gives the gui once for the whole game. I tried reseting and touching it but it will only give it to me once. Any help?
gui = game.Lighting.Q1:clone() script.Parent.Touched:connect(function(plr) if plr.Parent:findFirstChild("Humanoid") then local plyr = game.Players:findFirstChild(plr.Parent.Name) gui.Parent = plyr.PlayerGui end end) |
|
|
| Report Abuse |
|
|
|
| 19 Sep 2012 02:57 PM |
function ont(hit) local g = game.Players:GetPlayerFromCharacter(hit.Parent) game.Lighting.QI:clone().Parent = g.PlayerGui end
script.Parent.Touched:connect(ont) |
|
|
| Report Abuse |
|
|
|
| 19 Sep 2012 02:59 PM |
Tried it. Here's the output:
15:58:49.700 - Workspace.Q1.Script:3: attempt to index local 'g' (a nil value) 15:58:49.701 - Script "Workspace.Q1.Script", Line 3 15:58:49.707 - stack end 15:58:49.724 - Disconnected event because of exception |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 19 Sep 2012 03:11 PM |
| I fixed the problem. All it needed was an if statement. Thanks for the help. :) |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 19 Sep 2012 03:25 PM |
local plyr = game.Players:findFirstChild(plr.Parent.Name)
script.Parent.Touched:connect(function(plr) a = plr.Parent:findFirstChild("Humanoid") then gui = game.Lighting.Q1:clone().Parent = plyr.PlayerGui end end) --dunno about ends |
|
|
| Report Abuse |
|
|