Support for starter tools

I had a working script that allow players to start with a weapon, however recently it has broke and I have spent hours stuck on this problem. Perhaps there is something I have not noticed?

The code

Output

Notice how that one line of code is ignored.

1 Like

instead of doing that with a script, i suggest you just put the weapon in “StarterPack”

1 Like

@Auxicon notice how Lua trys to run everything at the same time
You can try by adding a then at print(“A”) and print(“B”)
Because Lua trys to run everything so quickly.another thing to slow it down is to add a wait between print(“A”) and the 2nd like and between

StartWeapon.Parent = player:WaitForChild("Backpack")
between print("B")

i suggest wait(.6)

1 Like

Much easier depending what your trying to make

I should have assumed that Lua was attempting to run all of the code at once. Thanks for pointing that out!

1 Like

No problem,Also i parent my objects like this for example

game.Lighting:WaitForChild("SpeedCoil").Parent = player.Backpack

That’s not how Lua works. It runs everything one after another, line by line.

waits dont make it ‘run line by line’, as @posatta said, it runs line by line by nature, theyre just being executed immediately after one another, waits just increase the time between lines, as it states