Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
7_c 37
7 years ago
Edited 7 years ago

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

Log in to vote
0
Answered by
j236 26
7 years ago
Edited 7 years ago

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
1
I would appreciate a more specific answer. 7_c 37 — 7y
0
I'm just posting to say what @j236 said was pretty rude and that's not how people should act around here. plasma_node 343 — 7y
0
Don't start a flame war guys. M39a9am3R 3210 — 7y
Ad

Answer this question