|
| 18 Oct 2014 11:55 AM |
Removing all guis ontouch. says line 2: attempt to index nil value
function Remove(hit) game.Players:getPlayerFromCharacter(hit.Parent).playerGui:ClearAllChildren() end workspace.Rem0ve.Touched:connect(Remove) |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2014 11:56 AM |
PlayerGui needs a capital. You also should be more careful with this, it won't always be a person touching your part. Try this code instead:
function Remove(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player and player:FindFirstChild("PlayerGui") then player.PlayerGui:ClearAllChildren() end end
game.Workspace.Rem0ve.Touched:connect(Remove) |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2014 11:57 AM |
| thx, but the place im in only players can touch all else in anchored. |
|
|
| Report Abuse |
|
|