I don't mind changing the way i do it, i just need something that works
--- there is a lot more to the script above this local mouse = player:GetMouse() local mh = mouse.Hit ev:FireServer(mh) local currentmh = mh mouse:GetPropertyChangedSignal("Hit"):Connect(function() if(mh ~= currentmh)then mh = mouse.Hit currentmh = mh print("hit changed") wait() ev2:FireServer(mh) end end)
GetPropertyChangedSignal was disabled for Hit because it'd update way too often, IIRC.
You can try and use a loop in RenderStepped to check for it, specifically after user input (Priority 100)
--NOTE: untested local mouse = game:GetService"Players".LocalPlayer:GetMouse() local mh = mouse.Hit ev:FireServer(mh) local currentmh = mh game:GetService"RunService":BindToRenderStep("MHUpdate",Enum.RenderPriority.Input.Value + 1,function() mh=mouse.Hit if(mh ~= currentmh)then mh = mouse.Hit currentmh = mh print("hit changed") wait() ev2:FireServer(mh) end end)
See the articles below for some more info.
https://developer.roblox.com/en-us/api-reference/function/RunService/BindToRenderStep
https://developer.roblox.com/en-us/api-reference/function/RunService/UnbindFromRenderStep
https://developer.roblox.com/en-us/api-reference/event/RunService/RenderStepped