So ive been trying to make a brick that once clicked gives you an object. I have the script set up to go from the Lighting but i want the tool itself to be a Child of the ParentPart and still give it to you.
function hi(x) local y = x.Backpack local z = game.Lighting["Gun"] z:Clone().Parent = y end script.Parent.ClickDetector.MouseClick:connect
Please help Anons
All you need to to is move "Gun" from lighting into the part and this script will work.
Also another tip don't use lowercase connect since roblox have deprecated it.
function hi(x) local z = script.Parent.Gun z:Clone().Parent = x.Backpack end script.Parent.ClickDetector.MouseClick:Connect(hi)
You need to add "(function()" after connect.
Example:
script.Parent.ClickDetector.MouseClick:connect(function()