generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Nil Value

Previous Thread :: Next Thread 
Casxul is not online. 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 is online. 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 is not online. qrushed
Joined: 10 Apr 2012
Total Posts: 587
18 Jul 2017 11:26 AM
Guis are clientsided (LocalScripts)
Report Abuse
Casxul is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image