--For this one, you'll need a `CFrameValue`.
Workspace.CFrameValue.Changed:Connect(function(NewValue)
print(NewValue)
end)
Workspace.CFrameValue.Value = CFrame.new(0, 20, 0)
local Game = game
local Workspace = workspace
local RunService = Game:GetService("RunService")
local Part = Workspace.Part
local CFrameValue = Part.CFrameValue
local function OnChanged(Value)
print(Value)
end
local function OnHeartbeat()
CFrameValue.Value = Part.CFrame
end
CFrameValue.Changed:Connect(OnChanged)
RunService.Heartbeat:Connect(OnHeartbeat)
Its a cframe, theres no parts, this wont work, I said u assign a cframe, a literal one
the function takes in a cframe, no parts, read more carefully then reply, it can be any cframe, a part’s cframe, a actual cframe like CFrame.new(1,1,1) there’s no parts
It is possible I misunderstood your question, but it sounds like you have something which will receive a CFrame, and not a property change. If this is the case you could call the function f() whenever the function ListenForCall() is fired.
Otherwise I would create a BindableEvent | Roblox Creator Documentation instead of passing a function through. You would then call :Fire() on the bindable even once the function is called and do bindableEvent.Event:Connect(f) somewhere else in the code.
-- Example w/o bindable event:
function ListenForCall(cf: CFrame, f: Function)
f()
...
end
-- Example with bindable event:
local cframeAssigned: BindableEvent = Instance.new("BindableEvent")
function ListenForCall(cf: CFrame)
cframeAssigned:Fire()
...
end)
cframeAssigned.Event:Connect(f)