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

Argument 1 is not missing. but why does it say it is missing?(RemoteEvents)

Asked by 4 years ago
game.ReplicatedStorage.GetBag.OnServerEvent:Connect(function(player, bag)
&   local a = game.Workspace.Bags:FindFirstChild(bag):Clone()
    a.Parent = player.Character
    a.Handle.Anchored = false
    player.bagName.Value = bag
end)

For some reason it says 'argument 1 missing or nil' in the place where the ampersand(&) is. Can anybody help?

0
it means 'bag' doesn't exist Elixcore 1337 — 4y
0
is it possible that 'bag' was created on the client? it won't be replicated otherwise abnotaddable 920 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

:FindFirstChild takes a string, because it for an instance by its name. local a = game.Workspace.Bags:FindFirstChild(bag.Name):Clone().

Ad

Answer this question