ok so i made this gear named "woodensword" --with all the animation done and all that, basically a sword that can swing and do damage. i wanted to make a script that gives the player the woodensword when they touch a part named "fire1".
function onTouch(fire1) local Toucher = fire1.Parent:FindFirstChild("Humanoid") --The toucher if Toucher ~= nil then --if someone touched fire1 local gear = game.ServerStorage.woodensword gear:Clone().Parent = Toucher:FindFirstChild("Backpack")
end
end --yea so basically when you touch the part(fire1), you will get that woodensword
however, i have no idea why it is not working.
gear:Clone().Parent = Toucher:FindFirstChild("Backpack")
Backpack is not a member of the Character's Humanoid. It will parent it to nil.
Part 1:
-- // Variables local Tool = game.ServerStorage.woodensword local Giver = script.Parent -- // The Part That Will Be Clicked local New = Tool:Clone -- // Getting The Click Detector To Work Giver.ClickerDetector.MouseClick:Connect(function(player) -- // If The Player Doesnt Already Have The Part Then -- // When The 'Giver' Is Clicked The Player Will Be Recived With The Tool. if New.Parent ~= player.Backpack then New.Parent = player.Backpack