[Help] Show ID script /showid

I want a to make a script (or find one) where the command “/showid [FirstName] [Lastname]” Will output what the user types in for their first and last name.

Make a new resource on your server and call it whatever you would like, then make the 2 files listed below and put the text below into them.

__resource.lua

server_script 'server.lua'

server.lua

AddEventHandler('chatMessage', function(source, n, message)
    local args = stringsplit(message, ' ')
    if (args[1] == "/showid") then
        local first = table.remove(args, 2)
        local last = table.remove(args, 2)

        if (first ~= nil and last ~= nil) then
            TriggerClientEvent('chatMessage', -1, 'ID', {0, 0, 0}, '('..n..') First: '..first..' Last: '..last)
        end

        CancelEvent()
   end
end)

function stringsplit(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end

Edited the first reply, copy that and it should work.

I was testing it and you were right. I did something wrong with the tables but now it should work.

Do you think you could add compatibility for FX and add a random DOB function ranging from 1936-2002?

What are you even talking about, this is compatible with FXServer. IDK why you think it wouldn’t be.

1 Like

Yea Sorry, I know it was my bad it wasn’t working at first but it was my simple mistake. Do you think its possible you could add a random DOB or something similar because a lot of servers including mine use CADs and having the DOB is a nice touch.

it’ll be in the works

Thank you! A lot! :grinning: :grinning:

https://gyazo.com/2d6a1a07d8d1d2abbcb965bf7221c41d

That’s right, you need to do it like that. There needs to be 2 args to do what you are trying to do

1 Like

thanks i been looking for this script for some time

Did you ever get a chance to do the random DOB?

No sorry :cry:

(dang character limit)