Connect to Database/Read

Hi all ,
i found this script ( Orbital_cannon)Orbital Cannon
, and it is usable by all players in game by pressing F1,
i want this to be protected , and only being used by a certain Group , Every player gets saved in our Database and also with a group/permission level ( Essentialmode)
This script doesnt work with Mysql , so i tried to edit a few things here and there ., but it doesnt work out for me .

so i tried to let it read from the DB by adding to the resource file

server_script ‘@mysql-async/lib/MySQL.lua’

and to check if u have the right permission in client.lua

if xPlayer.getGroup() == ‘superadmin’ then

But it returns in console(f8) attempting to index a nil valua Xplayer

Someone that can help me out ?
appreciate it

Xplayer is not defined

Ah oke ,
i added :

AddEventHandler(‘esx:playerLoaded’, function(source)

local _source        = source

local xPlayer        = ESX.GetPlayerFromId(_source)



MySQL.Async.fetchAll(

	'SELECT * FROM users WHERE group = @group',

	{

		['@group'] = xPlayer.group

	},

end)

now i keep getting unexpected end’s , so i tried to remove some end’s and replacing it ,
but it wont work out for me .,

I have not used mySql before. But try make the “end)” into just “)”

still gives me errors about unexpected end ,. is it possible to secure the script by a simple steamid check ?