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
|
  |
| 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
|
  |
| 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 |
|
|