Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script does not work, error in output "Argument 1 missing or nil" line 13?

18:42:07.786 - Argument 1 missing or nil 18:42:07.789 - Stack Begin 18:42:07.789 - Script 'ReplicatedFirst.GuiGearGiverSCRIPT', Line 13

local playergui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
 
playergui.ScreenGui2.Frame.Button.MouseButton1Click:connect(function(click) 
	
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Enabled = false 

local id= game.Players.LocalPlayer.PlayerGui.ScreenGui2.Frame.ID.Text 

local backpack = game.Players.LocalPlayer.Backpack 

local gearId = tonumber(id) 

local root = game:GetService("InsertService"):LoadAsset(gearId) 
	root.Name = "InsertedObject" .. gearId
root.Parent= backpack 

1 answer

For God sakes, the argument is empty, you need to insert the gear id inside it.

EDIT

If you can't understand crap, learn.

local plr = game.Players.LocalPlayer
local plrGui = plr:WaitForChild("PlayerGui")
local screenGui = plrGui.ScreenGui2
local id = screenGui.Frame.ID.Text
local backpack = plr.Backpack
local gearId = id

while wait(0.2) do
	local root = game:GetService("InsertService"):LoadAsset(gearId)
     root.Name = gearId
     root.Parent = backpack
end

3 comments

1

I would appreciate a more specific answer.

0

I'm just posting to say what @j236 said was pretty rude and that's not how people should act around here.

0

Don't start a flame war guys.

This discussion is preserved as it was. New answers, comments, and votes are closed.