Skip to content

Commit 239681e

Browse files
Added the key argument
Added the argument 'key', which is the key used to pass the key system.
1 parent 7e77fd2 commit 239681e

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ KeySystem.Initialize({
3737
Script_Name = "Name of Script", -- Optional
3838
Script_Creator = "Script Creator", -- Optional
3939
Paste_ID = "Paste ID", -- THIS IS VERY IMPORTANT, MAKE SURE IT MATCHES YOUR PASTE ID
40-
Callback = function()
41-
any_function()
40+
Callback = function(key)
41+
any_function(key)
4242
end
4343
})
4444
```
4545

4646
Note that you do not have to give a value for `Script_Name` or `Script_Creator` if you want to automatically get that information from Bloxybin. Simply leave it as nil (don't mention it in the table). Only the `Paste_ID` and `Callback` are necessary for the script to work.
4747

48+
If you want to display key information yourself, then the script will automatically pass the variable `key` into the function, which was successfully used.
49+
4850
After all this setup, you would have a working key system that's integrated with the BloxyBin key system.
4951

5052
## Bypass key
@@ -56,8 +58,8 @@ KeySystem.Initialize({
5658
Script_Creator = "Script Creator",
5759
Paste_ID = "Paste ID",
5860
Bypass_Key = "Whatever string"
59-
Callback = function()
60-
any_function()
61+
Callback = function(key)
62+
any_function(key)
6163
end
6264
})
6365
```

main.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ local function Make_Menu(settings)
364364

365365
BloxybinKeySys:Destroy()
366366

367-
local suc, msg = pcall(settings.Callback)
367+
local suc, msg = pcall(settings.Callback, Key_Input.Text)
368368
if not suc then
369369
warn([[==============
370370
Error. Key System couldn't run script!
@@ -415,7 +415,7 @@ main.Initialize = function(settings)
415415

416416
if settings.Bypass_Key then
417417
if key == settings.Bypass_Key then
418-
local suc, msg = pcall(settings.Callback)
418+
local suc, msg = pcall(settings.Callback, key)
419419
if not suc then
420420
warn([[==============
421421
Error. Key System couldn't run script!
@@ -428,7 +428,7 @@ main.Initialize = function(settings)
428428
local key_status = check_key(key, settings.Paste_ID)
429429

430430
if key_status == 200 then
431-
local suc, msg = pcall(settings.Callback)
431+
local suc, msg = pcall(settings.Callback, key)
432432
if not suc then
433433
warn([[==============
434434
Error. Key System couldn't run script!

0 commit comments

Comments
 (0)