beeflord
|
  |
| Joined: 06 Jun 2009 |
| Total Posts: 3372 |
|
|
| 04 Nov 2011 10:25 AM |
while true do wait() if game.Workspace.Game1.Hovers.Hover1 == exist then game.Workspace.Game1value.Value = 1 else game.Workspace.Game1value.Value = 0 end end
This is supposed to check if a specific part exists. If it exists, then a value changes to 1. If not, then it changes to 0.
It's not working ofcourse. Can someone tell me how to make it work? Thank you. |
|
|
| Report Abuse |
|
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 04 Nov 2011 10:29 AM |
if game.Workspace.Game1.Hovers:findFirstChild("Hover1") then OR if game.Workspace.Game1.Hovers:findFirstChild("Hover1") ~= nil then
now if you want it to check that it doesnt then if game.Workspace.Game1.Hovers:findFirstChild("Hover1") == nil then |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 04 Nov 2011 10:33 AM |
"now if you want it to check that it doesnt then if game.Workspace.Game1.Hovers:findFirstChild("Hover1") == nil then" "if game.Workspace.Game1.Hovers:findFirstChild("Hover1") ~= nil then"
Eh, don't use '~=nil', or '==nil' use either
if game.Workspace.Game1.Hovers:FindFirstChild("Hover1") then
or
if not game.Workspace.Game1.Hovers:FindFirstChild("Hover1") then |
|
|
| Report Abuse |
|
|
beeflord
|
  |
| Joined: 06 Jun 2009 |
| Total Posts: 3372 |
|
|
| 04 Nov 2011 10:33 AM |
| Thank you, it works perfectly. |
|
|
| Report Abuse |
|
|