|
| 29 Jan 2012 01:37 PM |
The goal is for the parent to be removed from the player's backpack. They player has a Boolvalue declaring if they are admin or not too. Any help?
p = script.Parent.Parent.Parent while true do wait(1) if (p:findFirstChild("Admin")) then wait(1) if (p.Admin.Value == false) then script.Parent:remove() else break end end
|
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 01:41 PM |
while wait() do if script.Parent.Parent:FindFirstChild("Admin") and script.Parent.Parent.Parent.Value == false then script.Parent:Destroy() -- remove() else break end end |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 01:42 PM |
| Use the .Changed event instead. A loop will lagg like crazy. |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 01:42 PM |
| True, but he may not know how to use the .Changed event... |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 01:44 PM |
| What would the .Changed event do. I have never heard of it before. >.< |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 01:47 PM |
| Well, it would do something if the Property of an object changes. |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 01:53 PM |
Oh, ok, but where would it be implemented?
|
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jan 2012 02:04 PM |
| While cuase lags, I prefer you need to use the Changed event ^^ |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jan 2012 02:07 PM |
| Sorry about the bump. I don't get where the changed event would go? |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 29 Jan 2012 02:09 PM |
while true do wait(0.3) if script.Parent.Parent:FindFirstChild("Admin") and script.Parent.Parent:FindFirstChild("Admin").Value == false then script.Parent:Destroy() end end
-- Tell me the location of the script, where the BoolValue: Admin is, what you want to be deleted |
|
|
| Report Abuse |
|
|