Skip to content

Commit bc7dfcb

Browse files
committed
refactor: change function declarations to local scope in vehicle spawner
1 parent bc252d4 commit bc7dfcb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

[examples]/test_vehicles/c_test_gui.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local spawnButton = guiCreateButton(50, 120, 200, 40, "Spawn Vehicle", false, wi
1313

1414
guiSetVisible(window, false)
1515

16-
function spawnVehicleByID(vehicleID)
16+
local function spawnVehicleByID(vehicleID)
1717
if not vehicleID then
1818
outputChatBox("Error: Please enter a valid number!", 255, 0, 0)
1919
return
@@ -28,7 +28,7 @@ function spawnVehicleByID(vehicleID)
2828
triggerServerEvent("newmodels-test_vehicles:requestVehicleSpawn", resourceRoot, localPlayer, vehicleID, spawnX, spawnY, z, rot)
2929
end
3030

31-
function requestVehicleSpawn()
31+
local function requestVehicleSpawn()
3232
local vehicleID = tonumber(guiGetText(input))
3333
spawnVehicleByID(vehicleID)
3434
guiSetVisible(window, false)
@@ -47,15 +47,15 @@ addEventHandler("newmodels-test_vehicles:vehicleSpawnResponse", localPlayer, fun
4747
end
4848
end)
4949

50-
function onInputEnter()
50+
local function onInputEnter()
5151
if source == input then
5252
requestVehicleSpawn()
5353
end
5454
end
5555

5656
addEventHandler("onClientGUIAccepted", input, onInputEnter)
5757

58-
function toggleSpawnerGUI()
58+
local function toggleSpawnerGUI()
5959
local visible = guiGetVisible(window)
6060
guiSetVisible(window, not visible)
6161
showCursor(not visible)

0 commit comments

Comments
 (0)