Skip to content

firetouchinterest

Avoid implementing in Luau

This function should not be implemented in Luau. Doing so exposes you to easy detection vectors.

firetouchinterest simulates a physical touch event between two BasePart objects. It can emulate both the start and end of a Touched event.

function firetouchinterest(part1: BasePart, part2: BasePart, toggle: boolean | number): ()

Parameters

Parameter Description
part1 The initiating BasePart.
part2 The BasePart that should be touched.
toggle Whether to simulate touch start or end. false or 0 simulates touch; true or 1 simulates un-touch.

Example

Simulating a Touched event using firetouchinterest
local dummy_part = Instance.new("Part")
dummy_part.CFrame = CFrame.new(0, -200, 0)
dummy_part.Anchored = true
dummy_part.Parent = workspace

dummy_part.Touched:Connect(function(part)
    print(part.Name .. " touched the dummy part!")
end)

local player_head = game.Players.LocalPlayer.Character.Head

firetouchinterest(player_head, dummy_part, false) -- Simulate touch
task.wait(0.5)
firetouchinterest(player_head, dummy_part, true) -- Simulate un-touch