I was making a weapon that you can only get if you click it, not touch it
The ScrewDriver is the Main Mesh Inside the ScrewDriver (Mesh) There is a Script,ClickDetector,ScrewDriver The other screwdriver that is the child of the screwdriver is the mainweapon, a tool
local weapon = script.Parent local Click = script.Parent.ClickDetector local mainweapon = script.Parent.ScrewDriver local player = game.Players.LocalPlayer local playerlocation = game.Players:FindFirstChild(""..player.Name) Click.MouseClick:Connect(function() mainweapon.Parent = playerlocation end)
But nothin is working, How can i fix this? please help
i also tried
local weapon = script.Parent local Click = script.Parent.ClickDetector local mainweapon = script.Parent.ScrewDriver local player = game.Players.LocalPlayer Click.MouseClick:Connect(function() mainweapon.Parent = player.Name.Backpack end)
Please Help, Advanced Thanks!
access the players Backpack
not name
you dont need to because name is a string value of the localplayers name not the actual player
local weapon = script.Parent local Click = script.Parent.ClickDetector local mainweapon = script.Parent.ScrewDriver Click.MouseClick:Connect(function(Player) mainweapon.Parent = Player.Backpack end)