So im trying to do a system where you can drag blocks and i used this link as an inspiration: https://www.youtube.com/watch?v=iRi2Mfow8qg
Here is one of the scripts which has the problem in it: so here is the local script: my problem is that it continously says"attempt to call boolean value" in output for this script at lines 24 and 46. I labeeld em, please help me. I can also cantact through discord
local TAG_NAME = 'Pickup'
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local collectionService = game:GetService("CollectionService")
local usserInput = game:GetService("UserInputService")
local requestGrab = game.ReplicatedStorage.RequestGrab
local stopGrab = game.ReplicatedStorage.StopGrab
local trackingPart = nil
local heartbeat
function UpdateTrackingPart()
local ray = mouse.UnitRay
local position = ray.Origin + (ray.Direction * 20)
trackingPart.BodyPosition.Position = position
end
function MouseDown()
local target = mouse.Target
if (target and requestGrab:InvokeServer(target)) then -------------------------------PROBLEM HERE
trackingPart = target
heartbeat = game:GetService("RunService").Heartbeat:Connect(UpdateTrackingPart)
end
end
function MouseUp()
if (not trackingPart) then return end
stopGrab:FireServer(trackingPart)
trackingPart = nil
heartbeat:Disconnect()
end
function CharacterAdded(character)
mouse.TargetFilter = character
end
usserInput.InputBegan:Connect(function(inputObject, processed)
if (processed) then return end
if (inputObject.UserInputType == Enum.UserInputType.MouseButton1) then
MouseDown() ------------------------------------------PROBLEM HERE
end
end)
usserInput.InputEnded:Connect(function(inputObject, processed)
if (inputObject.UserInputType == Enum.UserInputType.MouseButton1) then
MouseUp()
end
end)
CharacterAdded(player.CharacterAdded:Wait())
player.CharacterAdded:Connect(CharacterAdded)
thanks to anyone who tries to help
