I am trying to make it so when the player presses Q whatever tool they’re holding is dropped at the position of their mouse, however I can’t get it working
Issues:
– Tool does not parent correctly (seems like it’s forced back into the player’s character)
– Tool if parented correctly is still located at the player’s hand
Server-Side Code
local Players = game:GetService("Players")
local ToolPlayer
script.Parent.Touched:Connect(function(TouchPart)
if not ToolPlayer then
ToolPlayer = Players:GetPlayerFromCharacter(TouchPart.Parent)
end
if not ToolPlayer then
return
end
script.Parent.Parent.Parent = ToolPlayer.Character
end)
script.Parent.Unequip.OnServerInvoke = function(Player, Position: Vector3)
if Player ~= ToolPlayer then
return
end
if typeof(Position) ~= "Vector3" then
print(typeof(Position))
return
end
script.Parent.Parent.Parent = workspace
script.Parent.CFrame = CFrame.new(Position)
end