My mainmodule:
if workspace:FindFirstChild("Sword Admin v3") then return {script; on = true;} else print("Sword Admin is not inserted correctly into this place.") return {script; on = true;} end
So, Is there? People constantly tell me there is but don't further explain it. All help is appreciated!
Note: It's 3am... I'm going to sleep so I'll check on this in the morning!
ALSO, YES, MY CODE DOES WORK!
Yes there is.
assert(workspace:FindFirstChild("Sword Admin v3"),"Sword Admin is not inserted correctly into this place.") return {script; on = true;}
assert
is a function that takes 2 parameters.
First one is a bool [a],
second is string [b].
If a
is false
or nil
, then assert
errors b
.
Keep in mind that FindFirstChild
returns Instance
or nil
.
I don't understand why would you want to return script
in a modulescript...
If assert
will error then the function will return nothing.
Additionally, you could try returning the table before calling assert
.
Please mark as solved if helped. Thanks!