of     1   

GamerX2O
#227506854Monday, November 13, 2017 2:47 AM GMT

while checker == true do wait(0.1) if OakWood == nil then print("Nil") checker = false end end OakWood is a model. In a different script, when OakWood is clicked on it removes OakWood. So theoretically when this checks on OakWood and finds that OakWood doesn't exist it should put out a nil value right? But it never prints "Nil" in the output meaning that it never gets past the "If" statement. Please help me.
jaden2blox
#227507096Monday, November 13, 2017 2:53 AM GMT

@Gamer Have you tried using "While true do" instead of "while checker == true do"?
GamerX2O
#227507162Monday, November 13, 2017 2:55 AM GMT

That doesn't work
GamerX2O
#227507533Monday, November 13, 2017 3:04 AM GMT

So I found a way around my problem here. What I did was in the script where the OakWood is Removed, before it is removed I turn it invisible for 0.4 seconds. Then instead of checking if it is Nil, i check if it has a Transparency of 1. Here: while checker == true do wait(0.1) if OakWood.ClickPart.Transparency == 1 then print("Nil") checker = false end end But I also want to point out that over ## ###### ###### this and only 1 actually tried to help me. But it's ok guys. I understand. I'm not welcome here
doggy00
#227507599Monday, November 13, 2017 3:06 AM GMT

First off, to make your code "more efficient" for future work, you can replace "checker == true" with just "checker". You can also replace the "==nil" with "not" at the beginning: while checker do wait(0.1) if not OakWood then print("Nil") checker = false end end This isn't keeping the script from working, it's just a more professional way of writing the code. Another way that might work rather than just using a loop like this is to connect the model to an AncestryChanged event, and if the ancestor is nil then the function connected to the event would trigger: OakWood.AncestryChanged:connect(function(inst, parent) if not parent and checker then print("Nil") checker = false end) However, if your original code doesn't work, this likely won't, either. Try throwing in a print between the wait(0.1) and the "if...then" line to make sure checker == true.
GamerX2O
#227507767Monday, November 13, 2017 3:11 AM GMT

Thank you for the advice on making my code more professional, i actually didn't know that "If x then" was the same as "If x = true then" :D

    of     1