I'm trying to make it so when a player presses x and the tool touches a player, the tool goes into the player's inventory who got touched with the tool.
local UserInputService = game:GetService("UserInputService")
local ToolHandle = script.Parent.Handle
ToolHandle.Touched:Connect(function(Part)
if (UserInputService:IsKeyDown(Enum.KeyCode.X)) then
local Humanoid = Part.Parent:FindFirstChild("Humanoid")
if (Humanoid) then
local Player = tostring(Humanoid.Parent.Name); print(Player)
script.Parent = game.Players.Player:WaitForChild("Backpack")
end
end
end)

2 comments
Yeah. You're not using the full update, I made the final tweek, apply that instead
sent