Skip to content

Commit 994b9ac

Browse files
authored
Merge pull request #32 from ryanlua/const-keyword
2 parents dd56f7a + c514063 commit 994b9ac

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

docs/api-reference.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ The following code sample, placed within a child `LocalScript` of a `GuiButton`,
99
``` lua title="Inventory Toggle Button" linenums="1"
1010
--!strict
1111

12-
local ReplicatedStorage = game:GetService("ReplicatedStorage")
12+
const ReplicatedStorage = game:GetService("ReplicatedStorage")
1313

14-
local Purse = require(ReplicatedStorage.Purse)
14+
const Purse = require(ReplicatedStorage.Purse)
1515

16-
local button = script.Parent
16+
const button = script.Parent
1717

18-
local function onButtonActivated()
18+
const function onButtonActivated()
1919
if Purse.OpenClose then
2020
Purse.OpenClose()
2121
end
@@ -97,9 +97,9 @@ The following code sample, placed within a child `LocalScript` of `StarterPlayer
9797
``` lua title="Detect Inventory State" linenums="1"
9898
--!strict
9999

100-
local ReplicatedStorage = game:GetService("ReplicatedStorage")
100+
const ReplicatedStorage = game:GetService("ReplicatedStorage")
101101

102-
local Purse = require(ReplicatedStorage.Purse)
102+
const Purse = require(ReplicatedStorage.Purse)
103103

104104
Purse.StateChanged.Event:Connect(function(isNowOpen)
105105
if isNowOpen then

src/Attribution.client.luau

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
Thank you for supporting Purse.
2929
]]
3030

31-
local MarketplaceService = game:GetService("MarketplaceService")
32-
local RunService = game:GetService("RunService")
31+
const MarketplaceService = game:GetService("MarketplaceService")
32+
const RunService = game:GetService("RunService")
3333

34-
local VERSION = "1.1.5"
34+
const VERSION = "1.1.5"
3535

3636
-- Print attribution. Do not modify without reading above
3737
if not RunService:IsStudio() then
@@ -41,7 +41,7 @@ end
4141
-- Check for updates. You may modify the below
4242
local latestVersion: string?
4343

44-
local success, result = pcall(function()
44+
const success, result = pcall(function()
4545
return MarketplaceService:GetProductInfoAsync(112061170330936)
4646
end)
4747

src/ContextAction.client.luau

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
--!strict
22

3-
local ContextActionService = game:GetService("ContextActionService")
4-
local BackpackScript = require(script.Parent)
3+
const ContextActionService = game:GetService("ContextActionService")
4+
const BackpackScript = require(script.Parent)
55

6-
local ACTION_NAME = "BackpackToggle"
6+
const ACTION_NAME = "BackpackToggle"
77

8-
local function handleAction(actionName, inputState, _inputObject)
8+
const function handleAction(actionName, inputState, _inputObject)
99
if actionName == ACTION_NAME and inputState == Enum.UserInputState.Begin then
1010
if BackpackScript.OpenClose then
1111
BackpackScript.OpenClose()

src/CoreGuiWarn.client.luau

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--!strict
22

3-
local StarterGui = game:GetService("StarterGui")
3+
const StarterGui = game:GetService("StarterGui")
44

55
task.spawn(function()
66
while task.wait(3) do

src/TopbarIcon.client.luau

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
--!strict
22

3-
local BackpackScript = require(script.Parent)
4-
local Icon = require(script.Parent.Parent.topbarplus)
3+
const BackpackScript = require(script.Parent)
4+
const Icon = require(script.Parent.Parent.topbarplus)
55

6-
local icon = Icon.new()
6+
const icon = Icon.new()
77
icon:modifyTheme({ "IconLabelContainer", "TargetWidth", 0 }) -- Force minimum width
88
icon:setLabel("backpack")
99
icon:setOrder(-1)

0 commit comments

Comments
 (0)