Casxul
|
  |
| Joined: 12 Mar 2012 |
| Total Posts: 28 |
|
|
| 18 Jul 2017 11:25 AM |
Workspace.screen curtain.click2.Script:5: attempt to index global 'x' (a nil value)
I am trying to make it so when a player touches the button to close the curtain it says last closed by name. Here is what I have so far
script.Parent.ClickDetector.mouseClick:connect(function() for _,v in pairs(game.Workspace.curtain:GetChildren()) do v.Transparency = 0 script.Parent.Parent.screen.SurfaceGui.Frame.state.Text = "Closed" script.Parent.Parent.screen.SurfaceGui.Frame.pname.Text = "Last Controlled by: "..x.Name end end) |
|
|
| Report Abuse |
|
|
iiNemo
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 2380 |
|
|
| 18 Jul 2017 11:26 AM |
| ..x.Name, you are not defining what x is. |
|
|
| Report Abuse |
|
|
qrushed
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 587 |
|
|
| 18 Jul 2017 11:26 AM |
| Guis are clientsided (LocalScripts) |
|
|
| Report Abuse |
|
|
Casxul
|
  |
| Joined: 12 Mar 2012 |
| Total Posts: 28 |
|
|
| 18 Jul 2017 11:31 AM |
Thanks so much! I looked at my opening script and realized it was supposed to be this
script.Parent.ClickDetector.mouseClick:connect(function(x)
I had this.
script.Parent.ClickDetector.mouseClick:connect(function()
It's funny that tiny little word makes such a dramatic difference. |
|
|
| Report Abuse |
|
|
qrushed
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 587 |
|
|
| 18 Jul 2017 11:35 AM |
| it's not funny, it's perfectly logical lel. and I think it's script.Parent.ClickDetector.MouseClick() not script.Parent.ClickDetector.mouseClick() hopefully they both work as the latter is probably just a deprecation being used but I don't know for certain, you're better off using MouseClick |
|
|
| Report Abuse |
|
|