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

I'm trying to make a spawn script, but it only spawns one time, why?

Asked by 8 years ago

The script is here; It only spawns one item, and doesn't spawn any more.

local itemName = script.Parent.itemName
local user = game.Players.LocalPlayer
local plrName = script.Parent.getName


script.Parent.spawnItem.MouseButton1Down:connect(function()
    local item = game.Lighting.Items:FindFirstChild(itemName.Text)
    if item ~= nil then
        item:clone()

    local plr = game.Players:FindFirstChild(plrName.Text)
    local backpack = plr.Backpack

        item.Parent = backpack
end; end)

Answer this question