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: Part = nil. IKKKKKK

Previous Thread :: Next Thread 
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
27 Sep 2014 12:58 PM
I want it to change the text of a gui if a certain part is nil, but im getting the error that it is nil. How do i force check if its nil?

function Resize()
Mod = Game.Workspace:WaitForChild("Mod"..PlayerNumberValue.Value)
if Mod.Part then--if its not itll gimmie an error here.
Part = Mod.Part
Part.Size = Vector3.new(X.Value,Y.Value,Z.Value)
script.Parent.Parent:Destroy()
else
B1.Text = "You need a part first!"
wait(2)
B1.Text = "Resize"
end

end
B1.MouseButton1Down:connect(Resize)
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
27 Sep 2014 01:01 PM
nvm i found i different way to do it.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
27 Sep 2014 01:04 PM
function Resize()
Mod = Game.Workspace:WaitForChild("Mod"..PlayerNumberValue.Value)
found = Mod:FindFirstChild("Part") -- This will return true or false
if found then
Part = Mod.Part
Part.Size = Vector3.new(X.Value,Y.Value,Z.Value)
script.Parent.Parent:Destroy()
elseif not found then
B1.Text = "You need a part first!"
wait(2)
B1.Text = "Resize"
end

end
B1.MouseButton1Down:connect(Resize)
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