I have a gui with a slot and inside the slot is an imagge button and inside the button is a script and inside the script is a LinkedSword

Im trying to get it to where you click the button, it takes the sword out of the script and puts it in your inventory. But i cant.

here is my script

function onClick()
    local LinkedSword = script.LinkedSword:Clone()
    LinkedSword.Parent = game.Players.LocalPlayer.Backpack
end)
script.Parent.MouseButton1Click:connect(function()

3 comments

0

It appears you have a typo on line 2 (you wrote LinkedSwprd instead of LinkedSword when cloning it).

0

fixed, still doesent work

0

is this a localscript?