xNote | Death Note Script

xNote FiveM Death Note Script

Features

Discord ID allowlist
Ability to kill anyone from anywhere (onesync) after you looked at them
UI with folding page

How it Works

To use, use the command /xnote:toggle to active the book for yourself (must have perms). Next use the command /xnote:display to open the UI. Once the UI is open you can click on the right side (the lined paper) to start typing a PlayerName, if the name is valid, and you have seen that players ped before, then it will kill that player in 5 seconds.

Download Link (GitHub)

Dev Note

This script will work as is standalone but it is strongly recommended to edit the script to add notifications or link it to a framework so character names can be used instead of PlayerName. In addition, you can change the name of the commands and or add a keybind to them. ex. RegisterKeyMapping('xnote:display', 'Open Death Note', 'keyboard', "K"). As for performance, there is no active performance draw for anyone without a death note, and a very little 0.01ms for those idle with a death note. Please fill out the GetPlayerCharName function with how you want names to register, they are defaulted for the PlayerName.

local function GetPlayerCharName(svid)
		--todo !!!! IMPORTANT !!!!
		-- ADD YOUR FRAMEWORK OR NAME LOGIC HERE

		return GetPlayerName(svid)
	end

Conclusion

I made this a while back and have updated past the version I have released here, so I felt it would be a nice addition for those that are looking for something like this. I have a bunch of additional features that I made for this script after like Shinigami eyes and other things from the show. However, given the complexity of those features they relied heavily on my custom framework and would take too long to convert. Maybe one day I’ll get around to it. I don’t remember where I got the UI template for the folding page but will add credits if I do remember. Also note I don’t claim to own any IP from Death Note :slight_smile: .

Code is accessible Yes
Subscription-based N/A
Lines (approximately) 400+
Requirements None
Support No
7 Likes

yees finally

now i have death note :stuck_out_tongue_closed_eyes: :stuck_out_tongue_closed_eyes:

this would of been great for the youtubers on my old rp server

great work mate

Nice work mate!

Here is an improved version of your GetPlayerCharName function, it should work for both standalone, esx and qbcore by default (the user would just have to import their framework), feel free to use it if you want to.

local function GetPlayerCharName(svid)
	if GetResourceState("es_extended") == "started" and ESX ~= nil then -- ESX, make sure to add the import
		local player = ESX.GetPlayerFromId(svid)

		if player ~= nil then
			return player.getName()
		end
	elseif GetResourceState("qb-core") == "started" and QBCore ~= nil then -- QB-Core, make sure to add the import
		local player = QBCore.Functions.GetPlayer(svid)

		if player ~= nil then
			return player.PlayerData.charinfo.firstname .. " " .. player.PlayerData.charinfo.lastname
		end
	end

	return GetPlayerName(svid)
end
1 Like

This is crazy! How could one go about turning this into an item use instead of perms? TIA!

This would be easy, when a player gets the item trigger “xnote:hasBook” event to allow them to use the UI, then when they use the item you can trigger this event I just made

--- blah blah blah make item with your framework of choice


-- Client Side Code (will work with any framework)
RegisterNUIEvent("xnote:open", function(state)
    if hasDeathNote then
        if state == nil then state = not cur_action end
        display(state)
    else
        if cur_action then
            display(not cur_action)
        end
    end
end)


-- Server Side Example for QBCore
local hasItem = {} -- to check if the xnote:hasBook event has been triggered
QBCore.Functions.CreateUseableItem('xnote', function(source, item)
	local Player = QBCore.Functions.GetPlayer(source)
	if not Player.Functions.GetItemByName(item.name) then return end
	if not hasItem[source] then hasItem[source] = true; TriggerClientEvent("xnote:hasBook") end
	TriggerClientEvent("xnote:open")
end)

1 Like

thank you so much :face_holding_back_tears:

this is so brilliant

I don’t understand, I can’t configure it so that the death note works