I’ve been working on my custom handles (You can see my first post
). As the title says, I call a function and it never fires and the script won’t continue. I will do my best to show you where the problem happens.
game.Players.LocalPlayer:GetMouse().Move:Connect(function()
local _,Data,Pos = data.IsMouseInRay()
if Data and Data.Object then
LastData = Data
end
if InUse and typeof(Data) == "nil" and data.LastInRay and UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
local succes,err = pcall(function()
local Pos2D = GetSpaceVector(Data.Id) -- This function won't fire and the next code won't work
if LastType == LastData.Id then
LastPosition = GetPosition((Pos-LastData.Object.Position),Data.Id)
MouseDrag:Fire(LastData.Id,LastPosition)
elseif LastType ~= LastData.Id then
LastType = LastData.Id
LastPosition = GetPosition((Pos-LastData.Object.Position),Data.Id)
end
end)
elseif InUse and UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) and LastData then
local succes,err = pcall(function()
if LastType == LastData.Id then
LastPosition = GetPosition((Pos-LastData.Object.Position),Data.Id)
MouseDrag:Fire(LastData.Id,LastPosition)
elseif LastType ~= LastData.Id then
LastType = LastData.Id
LastPosition = GetPosition((Pos-LastData.Object.Position),Data.Id)
end
end)
end
end)
There are no errors.
I’m just testing GetSpaceVector so it doesn’t return anything, but it is a print in it that never gets called.
If you want to check GetSpaceVector then this is the code:
local GetSpaceVector = function(Space)
warn(typeof(Space)) -- The warn never gets called
--local IsFound,DataObject,Pos = data.IsMouseInRay()
local PosGot
end