local RunService = game:GetService("RunService")
local function WaitForChild(Name, Parent)
if not Parent:FindFirstChild(Name) then
repeat RunService.RenderStepped:Wait() until Parent:FindFirstChild(Name)
return Parent:FindFirstChild(Name)
end
end
local Folder = WaitForChild("Folder", script)
print("Regular found a folder!")
Strict Typing:
local RunService = game:GetService("RunService")
local function WaitForChild(Name : string, Parent)
if not Parent:FindFirstChild(Name) then
repeat RunService.RenderStepped:Wait() until Parent:FindFirstChild(Name)
return Parent:FindFirstChild(Name)
end
end
local Folder = WaitForChild("Folder", script)
print("StrictTyping found a folder!")
What’s like the point of it if it isn’t faster?
I think this explanation is pretty good. In short, if you fed a function the wrong argument, the type checker would warn you about it before you hit run.
Well, you spend less time debugging your code, which is definitely a good benefit. Also, the post I linked literally said that it might become more efficient in the future.