|
| 20 May 2013 10:48 AM |
this script is for find the factory in a tycoon when we don't know where we are and where the factory is
function find(what, where) if string.lower(what) == string.lower(where.Name) then print(where) return end find(what, where.Parent) end
local fff = find('Factory',script) print(fff)
-- OUTPUT -- Factory nil
the return don't works??? |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 10:51 AM |
oups, coy/paste error
if string.lower(what) == string.lower(where.Name) then print(where) return where end
still an error |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 10:56 AM |
You are trying to print script. Can't do that. You need to print script.Name. So your code is if what==where.Name then return(where.Name) |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 10:57 AM |
Or, if you are trying to print it's location: return where:GetFullName() |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 10:57 AM |
| found the error : remplacing find(what, where.Parent) by return find(what, where.Parent) works |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 11:07 AM |
I tried for about 15 minutes, to reply to this, but ROBLOX is ignorant, and blocked my code, when it contains nothing against the rules in it...
-bigdaddy92 |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 11:15 AM |
oh, but i can't make operation with it
like returning the ownerName, i got an error |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|