I did post this because I wanted to know how to set a function in a custom datatype.
For example
local Region4 = {}
type RegionObject = {
PlayerTouched : RBXScriptSignal,
Touched : RBXScriptSignal,
TouchEnded : RBXScriptSignal,
PlayerTouchEnded : RBXScriptSignal
}
function Region4.new(Size:Vector3, cf:CFrame, CanCollide:boolean?) : RegionObject
end
function Region4:ConvertPartToRegion(part:BasePart) : RegionObject
end
return Region4
I have “type RegionObject” in my script, and I defined some events in it.
But I couldn’t know how to define functions inside a custom datatype.
Can someone please tell how should i define a function in my custom datatype?
I want something like :
type custom_type = {
-- functions defined ( assume that function defined is "Func"
}
function example() : custom_type
end
example():Func()
and,
I want the function to show like the picture above when using a value that is the custom type
plz help
( ask me questions if you cant understand, im bad at explaining something like this )