of     1   

darkboeda
#41652479Friday, January 28, 2011 3:42 PM GMT

I've been working on this Self Deploying cover and at a certain point when i touched the "open" Button it spammed my output with "Attempt to call a nil value" Probably because i made for each part a seperate script (Easyer for me to overlook, Im still an amature scripter) and Because of that (4 Script for each button (Open/Close) I probably wont find the problem. Im sure noone will bother to see into this but if you would i'd be very grateful. http://www.roblox.com/Self-Deploying-Cover-WIP-Cant-fix-it-item?id=45058614
xXxXxdragonxXxXx
Top 100 Poster
#41652490Friday, January 28, 2011 3:43 PM GMT

Script here place.
xXxXxdragonxXxXx
Top 100 Poster
#41652492Friday, January 28, 2011 3:43 PM GMT

Please*
darkboeda
#41661152Friday, January 28, 2011 8:41 PM GMT

Well i would want to but there are eight scripts, wich are all slightly different :P
Krammy
#41661729Friday, January 28, 2011 8:52 PM GMT

Number the script 1 to 8, look in the output for the script name then post that script here.
Krammy
#41661742Friday, January 28, 2011 8:52 PM GMT

Number the scripts*
darkboeda
#41664020Friday, January 28, 2011 9:31 PM GMT

Ill just post them all :3 First off, the Layout Workspace>>>DCover1>>>Value/Close/Open/Side1/Side1b/Side2/Side2b Value = 1 Close>>>Scripts; Side1,Side1b,Side2,Side2b----ClickDetetctor Open>>>Scripts; Side1,Side1b,Side2,Side2b----ClickDetector Now the script's ALL BELOW IS PART OF THE CLOSE BUTTON Side1 Side1 = game.Workspace.DCover1.Side1 Value = script.Parent.Parent.Value if Value == 0 then function onClicked() Value.Value = 1 wait(1.3) for i = 1, 40, 1 do Side1.CFrame = Side1.CFrame * CFrame.new(-0.05, 0, 0) wait() end end else if Value == 1 then end end script.Parent.ClickDetector.MouseClick:connect(onClicked) Side1b Side1 = script.Parent.Parent.Side1b Value = script.Parent.Parent.Value if Value == 0 then function onClicked() Side1.Transparency = 0 for i = 1, 35, 1 do Side1.CFrame = Side1.CFrame * CFrame.new(-0.05, 0, 0) wait() end end else if Value == 1 then end Side1.Transparency = 1 end script.Parent.ClickDetector.MouseClick:connect(onClicked) Side2 Side2 = game.Workspace.DCover1.Side2 Value = script.Parent.Parent.Value if Value == 0 then function onClicked() wait(1.3) for i = 1, 40, 1 do Side2.CFrame = Side2.CFrame * CFrame.new(0.05, 0, 0) wait() end end else if Value == 1 then end end script.Parent.ClickDetector.MouseClick:connect(onClicked) Side2b Side2 = script.Parent.Parent.Side2b Value = script.Parent.Parent.Value if Value == 0 then function onClicked() Side2.Transparency = 0 for i = 1, 35, 1 do Side2.CFrame = Side2.CFrame * CFrame.new(0.05, 0, 0) wait() end end else if Value == 1 then end Side2.Transparency = 1 end script.Parent.ClickDetector.MouseClick:connect(onClicked) ALL BELOW IS PART OF THE OPEN BUTTON Side1 Side1 = script.Parent.Parent.Side1 Value = script.Parent.Parent.Value if Value == 1 then function onClicked() Value.Value = 0 for i = 1, 40, 1 do Side1.CFrame = Side1.CFrame * CFrame.new(0.05, 0, 0) wait() end end else if Value == 0 then end end script.Parent.ClickDetector.MouseClick:connect(onClicked) Side1b Side1 = script.Parent.Parent.Side1b Value = script.Parent.Parent.Value if Value == 1 then function onClicked() wait(1.3) Side1.Transparency = 0 for i = 1, 35, 1 do Side1.CFrame = Side1.CFrame * CFrame.new(0.05, 0, 0) wait() end end else if Value == 0 then end end script.Parent.ClickDetector.MouseClick:connect(onClicked) Side2 Side2 = script.Parent.Parent.Side2 Value = script.Parent.Parent.Value if Value == 1 then function onClicked() for i = 1, 40, 1 do Side2.CFrame = Side2.CFrame * CFrame.new(-0.05, 0, 0) wait() end end else if Value == 0 then end end script.Parent.ClickDetector.MouseClick:connect(onClicked) Side2b Side2 = script.Parent.Parent.Side2b Value = script.Parent.Parent.Value if Value == 1 then function onClicked() wait(1.3) Side2.Transparency = 0 for i = 1, 35, 1 do Side2.CFrame = Side2.CFrame * CFrame.new(-0.05, 0, 0) wait() end end else if Value == 0 then end end script.Parent.ClickDetector.MouseClick:connect(onClicked) Now the output keeps telling me "Attempt to call a nil value" Thingy. I got the message after i put the Value = script.Parent.Parent.Value if Value == 1 then Parts into the scripts
darkboeda
#41664118Friday, January 28, 2011 9:33 PM GMT

Side1 Side1b Side2 Side2b are bricks in the model DCover1 Anyother of the above behind Open or close are the scripts
ScripterJohn13
#41664379Friday, January 28, 2011 9:38 PM GMT

Dark add this to all scripts.... env = getfenv(); setfenv(1, setmetatable({},{ __index = function(t, k, v) return env[k] or error(k.."is a nil value.") end }))
darkboeda
#41664485Friday, January 28, 2011 9:40 PM GMT

Above or below the function?
ScripterJohn13
#41664571Friday, January 28, 2011 9:41 PM GMT

My bad do this one... It tells you what variable is nil. Add it at top of scripts. Than run them and look at the output. env = getfenv(); setfenv(1, setmetatable({},{__index = function(t, k, v) return env[k] or error(k.." is a nil value."); end})) print(x) --> x is a nil value
darkboeda
#41664781Friday, January 28, 2011 9:45 PM GMT

Hmm it still doesn't work, Output now give's me; Fri Jan 28 22:44:54 2011 - Running Script 'Side1' Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Open.Side1:2: x is a nil value. Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Open.Side1, line 2 Workspace.DCover1.Open.Side1, line 3 stack end Fri Jan 28 22:44:54 2011 - Running Script 'Side2' Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Open.Side2:2: x is a nil value. Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Open.Side2, line 2 Workspace.DCover1.Open.Side2, line 3 stack end Fri Jan 28 22:44:54 2011 - Running Script 'Side1b' Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Open.Side1b:2: x is a nil value. Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Open.Side1b, line 2 Workspace.DCover1.Open.Side1b, line 3 stack end Fri Jan 28 22:44:54 2011 - Running Script 'Side2b' Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Open.Side2b:2: x is a nil value. Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Open.Side2b, line 2 Workspace.DCover1.Open.Side2b, line 3 stack end Fri Jan 28 22:44:54 2011 - Running Script 'Side1' Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Close.Side1:2: x is a nil value. Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Close.Side1, line 2 Workspace.DCover1.Close.Side1, line 3 stack end Fri Jan 28 22:44:54 2011 - Running Script 'Side2' Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Close.Side2:2: x is a nil value. Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Close.Side2, line 2 Workspace.DCover1.Close.Side2, line 3 stack end Fri Jan 28 22:44:54 2011 - Running Script 'Side1b' Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Close.Side1b:2: x is a nil value. Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Close.Side1b, line 2 Workspace.DCover1.Close.Side1b, line 3 stack end Fri Jan 28 22:44:54 2011 - Running Script 'Side2b' Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Close.Side2b:2: x is a nil value. Fri Jan 28 22:44:54 2011 - Workspace.DCover1.Close.Side2b, line 2 Workspace.DCover1.Close.Side2b, line 3 stack end
darkboeda
#41664994Friday, January 28, 2011 9:49 PM GMT

When i just use the button as it is (broken :3) The output tells me this Fri Jan 28 22:48:35 2011 - attempt to call a nil value Fri Jan 28 22:48:35 2011 - Fri Jan 28 22:48:35 2011 - Disconnected event because of exception Fri Jan 28 22:48:35 2011 - attempt to call a nil value Fri Jan 28 22:48:35 2011 - Fri Jan 28 22:48:35 2011 - Disconnected event because of exception Fri Jan 28 22:48:35 2011 - attempt to call a nil value Fri Jan 28 22:48:35 2011 - Fri Jan 28 22:48:35 2011 - Disconnected event because of exception Fri Jan 28 22:48:35 2011 - attempt to call a nil value Fri Jan 28 22:48:35 2011 - Fri Jan 28 22:48:35 2011 - Disconnected event because of exception
ScripterJohn13
#41665015Friday, January 28, 2011 9:49 PM GMT

Obviously whatever you're calling x on in your script is a nil value. Workspace.DCover1.Close.Side1:2: x is a nil value. ----------------------------------------^^^^^^^^^^ x is a nil value can you not read. Its the x variable on line 2. Of the scripts ["Side1", "Side2", "Side1b", "Side2b"]
darkboeda
#41665033Friday, January 28, 2011 9:50 PM GMT

With the Script ENET just put it gives me the output 2 posts above.
darkboeda
#41665196Friday, January 28, 2011 9:53 PM GMT

If it's pointing out to line two then something is wrong with "Value = script.Parent.Parent.Value"
ScripterJohn13
#41665364Friday, January 28, 2011 9:56 PM GMT

My bad, you accidentally included print(x) which was an example. Dude that's my bad do this one lol at top of all scripts.... env = getfenv(); setfenv(1, setmetatable({},{__index = function(t, k, v) return env[k] or error(k.." is a nil value."); end}))

    of     1