|
| 12 Nov 2017 07:04 AM |
FilteringEnabled is blocking my Popup, and does nothing. It works inside studio, and does exactly what I want it to do, but when inside a real game, it does nothing and shows with the error: "attempt to index local 'plr' (a nil value)", and I would like to fix that. The script is inside a part in the workspace called Jerry (just for now), and the gui is inside the script to be copied. and this is the script that doesn't work:
local debounce = false local gui = script.gui
game.Workspace.Censor.Touched:connect(function() local plr = game.Players.LocalPlayer if debounce == false then debounce = true pizzajob:Clone().Parent = plr.PlayerGui wait(3) debounce = false end end)
|
|
|
| Report Abuse |
|
Pastures
|
  |
| Joined: 15 Aug 2015 |
| Total Posts: 943 |
|
|
| 12 Nov 2017 07:07 AM |
LocalPlayer can only be accessed through a LocalScript.
Put this script inside a LocalScript and it should work.
|
|
|
| Report Abuse |
|
mattscy
|
  |
| Joined: 06 May 2011 |
| Total Posts: 1079 |
|
|
| 12 Nov 2017 07:08 AM |
| put it in a local script in startercharacterscripts |
|
|
| Report Abuse |
|
|
| 12 Nov 2017 07:09 AM |
Alright thanks guys. It worked! :D
Very appreciated.
|
|
|
| Report Abuse |
|