Beginner lua coder, need help implementing script

Hi, this is my first post, thanks for stopping by. I’m trying to create a server of my own and I want to implement this fleeca minigame script. NoPixel-minigame Script by Jesper-Hustad

Been trying to figure out how to call the export from the client side and have no luck so far, anyone know how I should go about doing this? I’m currently using the third eye target function to call the event like this.

RegisterNetEvent('bb-jewelrob:keypad')
AddEventHandler('bb-jewelrob:keypad', function()
if exports["bb-inventory"]:hasEnoughOfItem("Gruppe6Card3", 1, true) then
        local minigame = exports["hacking"]:hack()
        if (minigame == true) then
            TriggerEvent("bb-keypad:unlockdoor")
			TriggerEvent("inventory:removeItem", "Gruppe6Card3", 1)
        else
            TriggerEvent("inventory:removeItem", "Gruppe6Card3", 1)
			TriggerEvent("DoLongHudText", "You Failed!", 2)
        end
else
    TriggerEvent("DoLongHudText", "Missing Items!", 2)
end
end)

But when I target it and attempt to run the event, it tells me “No such export hack in resource hacking”

Hey :slight_smile:
The export’s name seems to be hacking, so the synthax would be along those lines :
Extract from the resource file

exports["hacking"]:hacking(
    function() -- success
        print("success")
    end,
    function() -- failure
        print("failure")
    end)

So in that case…it will be like this?

RegisterNetEvent('bb-jewelrob:keypad')
AddEventHandler('bb-jewelrob:keypad', function()
if exports["bb-inventory"]:hasEnoughOfItem("Gruppe6Card3", 1, true) then
	exports["hacking"]:hacking(
    function() -- success
        TriggerEvent("bb-keypad:unlockdoor")
		TriggerEvent("inventory:removeItem", "Gruppe6Card3", 1)
    end,
    function() -- failure
        TriggerEvent("inventory:removeItem", "Gruppe6Card3", 1)
		TriggerEvent("DoLongHudText", "You Failed!", 2)
    end)
else
    TriggerEvent("DoLongHudText", "Missing Items!", 2)
end
end)

Yep, seems good to me !
The better way the be sure is to test, let me know if it worked :wink:

Hey, just wanna say thank you so much for trying to help me. I really appreciate it

I tried the code but now it seems to give me an error on the hacking resource side

Looks like the Selector of the #to-fast div returns null, but I don’t really know why.

I don’t know if it will change anything but you can try to add the following to the head of the index.html file :

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

Apparently there is already a similar line there, I checked this index.html with another one and it appears that this one is missing the language portion of it. Could that be the cause?

It seems like there is some conflict between the .js files and the index.html in the hacking resource file that is preventing it from working but I can’t tell what it is. Can anyone help?