Hi there!
I’ve recently got the error “Type ‘boolean’ could not be converted into ‘() → ()’” which I’ve not had before. I’m aware about typechecking and stuff like that, I just want to know how I get rid of this error, and what () → () actually means.
Here’s the script segment I get this error on:
Prompt.Triggered:Connect(function()
if PropHeld == false then
PropHeld = true --Error here
PropService.PropPickup(Prop, Attachment0)
HeartbeatConnection = RunService.Heartbeat:Connect(PropHeld)
print("Prop")
elseif PropHeld == true then
PropService.PropDrop(Prop)
PropHeld = false --Error here
HeartbeatConnection:Disconnect()
end
end)
This is the only time PropHeld is referenced besides being defined (local PropHeld = false
).
Any help is appreciated,
Thanks