Ip lock scripts

Hey, how can I IP lock my scripts? thanks.

Did you ever find out

--[[

Add IPs in the blacklist

Example:

local blacklist = {

    "56.20.947.20",

    "94.314.267.25"

}

]]

local blacklist = {

    "Placeholder"

}

-- The code, don't touch anything here --

RegisterServerEvent("rlPlayerActivated")

AddEventHandler("rlPlayerActivated", function()

    playerIP = stringSplit(GetPlayerEP(source), ":")[1]

    

    for _, ip in pairs(blacklist) do

        if playerIP == ip then

            DropPlayer(source, "You are blacklisted from this server.")

        end

    end

end)

function stringSplit(self, delimiter)

  local a = self:Split(delimiter)

  local t = {}

  for i = 0, #a - 1 do

     table.insert(t, a[i])

  end

  return t

end

You had a problem again, tell me here

Thats an ip blacklist

Explain more what you want

I need a ip lock were if i give one person it other people cant get it

I think you want like this,

You need put on server side

local YourIpAdress = "IP Address"

PerformHttpRequest('http://bot.whatismyipaddress.com/', function (errorCode, resultDataa, resultHeaders)
    ipaddress = resultDataa
	if YourIpAdress == ipaddress then
		print("Script works!")
	end
end)

but this is a so basic if u want more complex but more secure i can help you

1 Like
PerformHttpRequest('https://ip-check.online/myip.php', function(err, text, headers)
  if text == 'licenseip is here' then
    print('^2 Successfully ^0')
    --Your code here
        --Your code here
            --Your code here
                --Your code here
                    --Your code here
                        --Your code here
  else
    print('^1 Unauthorized access ^0')
    Wait(12000)
    os.exit()
  end
end, 'GET', "")

what should I put for the website part?

example code :

PerformHttpRequest('https://ip-check.online/myip.php', function(err, text, headers)
  if text == '127.0.0.1' then -- ip address
    print('^2 Successfully ^0')
    --Your code here
        --Your code here
            --Your code here
                --Your code here
                    --Your code here
                        --Your code here
  else
    print('^1 Unauthorized access ^0')
    Wait(12000)
    os.exit()
  end
end, 'GET', "")

And encode

2 Likes

Yes i get the code part but how do i do it on the website that I can have more than 1 ip in it

1 Like

want that 2

bro can you do it in robot codings ?

Recommendations to encode lua?

if u ever found out let me know bro