How do i put my script in nil?

i still have the same error, maybe u cant put stuff in nil anymore

Works for me, weird and interesting. Put it in as the first thing in code.

(localscript)

local hopperBin = Instance.new("HopperBin", nil)

script.Parent = hopperBin

-- then stuff here

doesnt work
image

You cant, unless you use Destroy().

That error happens when you try to parent something to nil too early. You can put this at the top of your code as a fix although its not best practice

task.wait(1)
script:Destroy()
1 Like

It’s being parented to PlayerScripts (I assum your LocalScript is inside StarterPlayerScripts)

Try adding a task.wait() at the top of your script before changing its parent.

1 Like

i had to do wait(1) , thank you!

Replace the line repeat wait() until game.Loaded with this one that’s more efficient:

if not game.IsLoaded() then
    game.Loaded:Wait()
end
1 Like