Hello
I need help with my system
I’m trying to make a system that allows you to pick up items with the player’s mouse, the problem is that I can’t pick up items in the Y axis
Script:
local Player = game.Players.LocalPlayer
local Camera = workspace.CurrentCamera
local character = Player.Character or Player.CharacterAdded:Wait()
local Mouse = Player:GetMouse()
local Target
local Down
Mouse.Button1Down:Connect(function()
if Mouse.Target ~= nil and Mouse.Target.Locked == false and Mouse.Target.Pickup.Value == true then
Target = Mouse.Target
Mouse.TargetFilter = Target
Down = true
end
end)
Mouse.Move:Connect(function()
if Down == true and Target ~= nil then
Target.Position = Mouse.Hit.Position
end
end)
Mouse.Button1Up:Connect(function()
Down = false
Mouse.TargetFilter = nil
Target = nil
end)
I’m still going to make the maximum distance from the player
I’m using a translator