Novetus_src/ShadersCompatibility.lua

96 lines
2.7 KiB
Lua
Raw Normal View History

2022-07-18 00:38:12 +03:00
-- allows 2007M, 2006S, 2007E, and 2009E users to join Shaders/HD servers, and vice versa
2022-07-08 01:12:47 +03:00
local this = {}
function this:Name()
2022-07-08 03:24:28 +03:00
return "Shader Client MP Compatibility"
2022-07-08 01:12:47 +03:00
end
function this:IsEnabled(Script, Client)
2022-07-08 01:12:47 +03:00
-- hate this so much
if (Client == "2007E" or Client == "2007M" or Client == "2006S" or Client == "2007E-Shaders" or Client == "2007M-Shaders" or Client == "2006S-Shaders" or Client == "2009E" or Client == "2009E-HD") then
2022-07-08 01:12:47 +03:00
return true
else
return false
2022-07-08 01:12:47 +03:00
end
end
function this:OnPrePlayerKicked(Player, Reason)
2022-07-12 03:35:21 +03:00
if (game.Lighting:findFirstChild("SkipSecurity") ~= nil) then
2022-07-08 01:12:47 +03:00
do return end
end
invalidSecurityVals = 0
2022-07-18 00:38:12 +03:00
for _,newVal in pairs(Player.Security:children()) do
if (newVal.Name == "ClientEXEMD5") then
if (newVal.Value ~= game.Lighting.Security.ClientEXEMD5.Value or newVal.Value == "") then
invalidSecurityVals = invalidSecurityVals + 1
2022-07-18 00:38:12 +03:00
end
end
if (newVal.Name == "LauncherMD5") then
if (newVal.Value ~= game.Lighting.Security.LauncherMD5.Value or newVal.Value == "") then
invalidSecurityVals = invalidSecurityVals + 1
2022-07-18 00:38:12 +03:00
end
end
if (newVal.Name == "ClientScriptMD5") then
if (newVal.Value ~= game.Lighting.Security.ClientScriptMD5.Value or newVal.Value == "") then
invalidSecurityVals = invalidSecurityVals + 1
2022-07-08 01:12:47 +03:00
end
end
end
2022-07-18 00:38:12 +03:00
if (invalidSecurityVals < 3) then
print(Player.Name .. " has "..invalidSecurityVals.." invalid security values! Verifying...")
validLauncher = false
hasTripcode = false
securityValues = 0
for _,newVal in pairs(Player.Security:children()) do
if (newVal.Name == "LauncherMD5") then
if (newVal.Value == game.Lighting.Security.LauncherMD5.Value) then
validLauncher = true
2022-07-18 00:38:12 +03:00
end
end
securityValues = securityValues + 1
end
for _,newVal in pairs(Player:children()) do
if (newVal.Name == "Tripcode") then
if (newVal.Value ~= "") then
hasTripcode = true
2022-07-18 00:38:12 +03:00
end
end
end
if (validLauncher == true and hasTripcode == true and securityValues == 3) then
print(Player.Name .. " is using a valid modified client!")
local ver = Instance.new("StringValue",game.Lighting)
ver.Name = "SkipSecurity"
local tempTag = Instance.new("StringValue",ver)
tempTag.Name = "Temp"
2022-07-18 00:38:12 +03:00
else
print(Player.Name .. " is using an invalid modified client! Kicking...")
2022-07-08 01:12:47 +03:00
end
else
print(Player.Name .. " is using an invalid modified client! Kicking...")
2022-07-08 01:12:47 +03:00
end
end
function this:OnLoadCharacter(Player, Appearance)
if (game.Lighting:findFirstChild("SkipSecurity") ~= nil) then
if (game.Lighting.SkipSecurity:findFirstChild("Temp") ~= nil) then
game.Lighting.SkipSecurity:remove()
2022-07-12 03:35:21 +03:00
end
2022-07-08 01:12:47 +03:00
end
end
function AddModule(t)
2022-07-12 03:35:21 +03:00
print("AddonLoader: Adding " .. this:Name())
2022-07-08 01:12:47 +03:00
table.insert(t, this)
end
_G.CSScript_AddModule=AddModule