So I’m trying to create an attack, but I want it to be less than or equal to the CFrame where the event fires from.
—> Local Script <—
local debounce = false
local UIS = game:GetService("UserInputService")
local character = plr.CharacterAdded or plr.CharacterAdded:Wait()
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.Two then
if not debounce then
debounce = true
script.RemoteEvent:FireServer(plr.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-23).p)
wait(1)
debounce = false
end
end
end)```
If I understand you correctly, you could use .magnitude - if you know the magnitude distance between the two points and know the distance at which you want the event to fire. For example:
if (point1.Position - point2.Position).magnitude < 10 then
CFrames have 12 values for positional and rotational components, comparing the rotational values wouldn’t make sense, while for positional values you can just compare the vector3 values by checking each axis