[SOLVED] Calling a function without parenthesis?
Asked by
3 years ago Edited 3 years ago
Hi there! So I found a script somewhere in the toolbox and decided to see how it is written. However in the script I saw that some functions are called without parenthesis and I don't get how. Can someone explain? Any help appreciated :)
It is a Module Script that looks something like this:
03 | local function disablePlacement(plane) |
04 | if (currentPlane) then |
05 | renderConnection:disconnect() |
06 | renderConnection = nil |
08 | module.currentPlane = nil |
09 | currentEvent:Destroy() |
12 | if (currentTexture) then |
13 | currentTexture:Destroy() |
17 | for i = 1 , #currentObjects do |
18 | local object = currentObjects [ i ] |
20 | currentObjects [ i ] = nil |
27 | local function setLoading(plane, isLoading) |
28 | if (plane.loading = = isLoading) then |
32 | plane.loading = isLoading |
34 | if (plane = = currentPlane) then |
36 | for i = 1 , #currentObjects do |
37 | setState(currentObjects [ i ] , states.loading) |
40 | for i = 1 , #currentObjects do |
41 | setState(currentObjects [ i ] , states.neutral, true ) |
50 | module.new = function (base, obstacles, grid) |
53 | plane.obstacles = obstacles |
54 | plane.position = base.Position |
55 | plane.size = base.Size |
57 | if (math.floor(. 5 + plane.size.X/grid) % 2 = = 0 ) then |
58 | plane.offsetX = -grid/ 2 |
63 | if (math.floor(. 5 + plane.size.Z/grid) % 2 = = 0 ) then |
64 | plane.offsetZ = -grid/ 2 |
70 | plane.stateEvent = Instance.new( "BindableEvent" ) |
71 | plane.stateChanged = plane.stateEvent.Event |
74 | plane.enable = enablePlacement |
75 | plane.disable = disablePlacement |
78 | plane.setLoading = setLoading |
83 | module.setLoading = setLoading |
84 | module.currentPlane = false |
NOTE: These are only some parts of the script, not the full version.
Again, any help will be appreciated :)