Code Monkey home page Code Monkey logo

zodworks's Introduction

Dependencies

Installation

  1. Download this repository: https://github.com/lalBi94/ZODWorks/archive/refs/heads/master.zip.
  2. Add this line to your resources.cfg file. (You can also start your core).
ensure ZODWorks

Usage

  1. Import the ZODWorks object on your fxmanifest.lua script with these lines.
shared_scripts {
    "@ZODWorks/shared/ZODWorks.lua"
}
  1. Now store the tool in a variable.
local ZODWorks = exports["ZODWorks"]:getSharedObject()
  1. You can now use all available functions. Exemple :
local myMoney = ZODWorks.Player:getMoneyFrom("bank") 
local currencyConvert = ZODWorks.Utils:formatCurrency(tostring(myMoney))

print(myMoney) -- 75900
print(currencyConvert) -- 75 900$

Add-Ons

You can add your own functions or triggers by placing them in ZODWorks/shared/AddOns/. Ideally, :

  • ZODWorks/shared/AddOns/<YOUR_SCRIPT>/locales/locales.lua (to add some langages)
  • ZODWorks/shared/AddOns/<YOUR_SCRIPT>/server-side.lua
  • ZODWorks/shared/AddOns/<YOUR_SCRIPT>/client-side.lua

Exemple :
ZODWorks/shared/AddOns/myCustomScript/myCustomScript.lua

ZODWorks = ZODWorks or {} -- To supress the error "Attempt to call a nil value"
ZODWorks.myCustomScript = {}

---@param str1 string The first string.
---@param str2 string The second string.
---@return string
function ZODWorks.myCustomScript:stringFusion(str1, str2) 
    return ("%s %s"):format(str1, str2)
end

setmetatable(ZODWorks, {__index = ZODWorks.myCustomScript})

[myCore]/myCustomScript/client.lua

local fusionString = ZODWorks.myCustomScript:stringFusion("Onde", "Folie")
print(fusionString) -- Onde Folie

Credit

Owner → General Zod (bilaaaaaaaaaal)
Discord → https://discord.gg/xpCc6XmUaX
Version → BETA

zodworks's People

Contributors

lalbi94 avatar

Stargazers

 avatar

zodworks's Issues

Add-Ons/ has a problem retrieving the ZODWorks object.

For example, this code comes from an add-on allowing you to set up functional ATMs.

[     script:ZODWorks] Error loading script shared/AddOns/KRPBank/KRPBank.lua in resource ZODWorks: @ZODWorks/shared/AddOns/KRPBank/KRPBank.lua:28: attempt to index a nil value (global 'ZODWorks')
[     script:ZODWorks] stack traceback:
[     script:ZODWorks] 	@ZODWorks/shared/AddOns/KRPBank/KRPBank.lua:28: in main chunk
[      c-scripting-core] Failed to load script shared/AddOns/KRPBank/KRPBank.lua.

ZODWorks.KRPBank = {}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.