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 » Scripting Helpers
Home Search
 

Re: Please help

Previous Thread :: Next Thread 
TCurrency is not online. TCurrency
Joined: 24 Jan 2011
Total Posts: 952
29 Oct 2013 11:29 AM
It says model is a nil value, when Model is defined on line 8

for _,v in pairs (game.Workspace:GetChildren()) do
if v.Name == "Tycoon" then
for _, e in pairs (v:GetChildren()) do
if e:findFirstChild("Tycoon") then
for _, f in pairs (e:GetChildren()) do
if f:IsA("StringValue") and f.Name == "OwnerName" then
if f.Value == script.Parent.Parent.Parent.Parent.Parent.Name then
Model = e:findFirstChild("ModelDoor")
end
end
end
end
end
end
end


Door1 = Model.Door1

Door2 = Model.Door2

Door3 = Model.Door3

Door4 = Model.Door4

Door5 = Model.Door5

Door6 = Model.Door6

Door7 = Model.Door7

Door8 = Model.Door8

Door9 = Model.Door9

Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
29 Oct 2013 12:16 PM
for _,v in pairs (game.Workspace:GetChildren()) do
if v.Name == "Tycoon" then
for _, e in pairs (v:GetChildren()) do
if e:findFirstChild("Tycoon") then
for _, f in pairs (e:GetChildren()) do
if f:IsA("StringValue") and f.Name == "OwnerName" then
if f.Value == script.Parent.Parent.Parent.Parent.Parent.Name then
Model = e:findFirstChild("ModelDoor")
end


Door1 = Model.Door1

Door2 = Model.Door2

Door3 = Model.Door3

Door4 = Model.Door4

Door5 = Model.Door5

Door6 = Model.Door6

Door7 = Model.Door7

Door8 = Model.Door8

Door9 = Model.Door9
break
end
end
end
end
end
end



Try that, maybe?
Is this the whole script?
Report Abuse
TCurrency is not online. TCurrency
Joined: 24 Jan 2011
Total Posts: 952
29 Oct 2013 12:19 PM
No, the doors are for a function, but I cut it out.

-The darkest seed around
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
29 Oct 2013 12:20 PM
When asking for help, please provide the entire script.
Report Abuse
TCurrency is not online. TCurrency
Joined: 24 Jan 2011
Total Posts: 952
29 Oct 2013 12:22 PM
print("Shutter Script Loaded")

PlayerName = script.Parent.Parent.Value


for _,v in pairs (game.Workspace:GetChildren()) do
if v.Name == "Tycoon" then
for _, e in pairs (v:GetChildren()) do
if e:findFirstChild("Tycoon") then
for _, f in pairs (e:GetChildren()) do
if f:IsA("StringValue") and f.Name == "OwnerName" then
if f.Value == script.Parent.Parent.Parent.Parent.Parent.Name then
Model = e:findFirstChild("ModelDoor")
end
end
end
end
end
end
end


Door1 = Model.Door1

Door2 = Model.Door2

Door3 = Model.Door3

Door4 = Model.Door4

Door5 = Model.Door5

Door6 = Model.Door6

Door7 = Model.Door7

Door8 = Model.Door8

Door9 = Model.Door9





function onClicked()
if Door2.Transparency == 0 then
print("Door Open")

script.Parent.Text = "Shutters (OPENED)"

Door2.Transparency = 1

Door2.CanCollide = false

wait(.001)

Door1.CanCollide = false

Door1.Transparency = 1

Door3.CanCollide = false

Door3.Transparency = 1

wait(.001)

Door4.CanCollide = false

Door4.Transparency = 1

Door5.CanCollide = false

Door5.Transparency = 1

wait(.001)

Door6.CanCollide = false

Door6.Transparency = 1

Door7.CanCollide = false

Door7.Transparency = 1

wait(.001)

Door8.CanCollide = false

Door8.Transparency = 1

Door9.CanCollide = false

Door9.Transparency = 1

elseif Door2.Transparency == 1 then

script.Parent.Text = "Shutters (CLOSED)"

Door9.CanCollide = true

Door9.Transparency = 0

Door8.CanCollide = true

Door8.Transparency = 0

wait(.001)

Door7.CanCollide = true

Door7.Transparency = 0

Door6.CanCollide = true

Door6.Transparency = 0

wait(.001)

Door5.CanCollide = true

Door5.Transparency = 0

Door4.CanCollide = true

Door4.Transparency = 0

wait(.001)

Door3.CanCollide = true

Door3.Transparency = 0

Door1.CanCollide = true

Door1.Transparency = 0

wait(.001)

Door2.CanCollide = true

Door2.Transparency = 0
end
end




script.Parent.MouseButton1Down:connect(onClicked)



-The darkest seed around
Report Abuse
TCurrency is not online. TCurrency
Joined: 24 Jan 2011
Total Posts: 952
29 Oct 2013 12:23 PM
Now door 2 is a nil value >.< Thanks anyway.

-The darkest seed around
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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