Okay, so I’ve been having this issue for a while now with models, where I literally can’t access certain child of the model when I clearly am syntactically correct.
I absolutely hate using Instance:WaitForChild() though, I don’t like spamming it, and second the Touched event ran but the weld creation didn’t, so it isn’t a loading issue.
You didn’t get what I meant, I meant that it’s better to use the “WaitForChild()” function as it is already developed by roblox and it doesn’t have memory loss.
I am open to most of the functions/events of Roblox, it’s just this one function that I just don’t like using. I still use it when I absolutely have to though.
There isn’t really anything wrong with that function… It exists so you could wait for an object to load, rather than setting a specific wait time such as wait(n).
When you use :Wait(), the code passes the statement as soon as the function is ready, when you use repeat wait() you wait even if that certain condition is met, that’s why I don’t use repeat wait() loops anymore, because there is usually a :Wait() event that can do the same thing, just better.
You shouldn’t script something inefficient knowing there’s a better way to do it, it just doesn’t make sense.
If that’s a concern to you why not just rewrite the wait() function so that it’s reliant on tick and Heartbeat?
local RunService = game:GetService("RunService")
local wait = function(waitTime)
local startTime = tick()
repeat RunService.Heartbeat:Wait() until startTime+waitTime < tick()
return tick()-startTime, elapsedTime()
end