diff --git a/source b/source index a858c721..16db69f2 100644 --- a/source +++ b/source @@ -40,7 +40,7 @@ hookfunction = missing("function", hookfunction) hookmetamethod = missing("function", hookmetamethod) getnamecallmethod = missing("function", getnamecallmethod or get_namecall_method) checkcaller = missing("function", checkcaller, function() return false end) -newcclosure = missing("function", newcclosure) +newcclosure = missing("function", newcclosure, function(f, ...) return f(...) end) getgc = missing("function", getgc or get_gc_objects) setthreadidentity = missing("function", setthreadidentity or (syn and syn.set_thread_identity) or syn_context_set or setthreadcontext) replicatesignal = missing("function", replicatesignal) @@ -4497,7 +4497,7 @@ CMDs[#CMDs + 1] = {NAME = 'antigameplaypaused', DESC = 'Clears the annoying box CMDs[#CMDs + 1] = {NAME = 'unantigameplaypaused', DESC = 'Disables antigameplaypaused'} CMDs[#CMDs + 1] = {NAME = 'clientantikick / antikick (CLIENT)', DESC = 'Prevents localscripts from kicking you'} CMDs[#CMDs + 1] = {NAME = 'clientantiteleport / antiteleport (CLIENT)', DESC = 'Prevents localscripts from teleporting you'} -CMDs[#CMDs + 1] = {NAME = 'allowrejoin / allowrj [true/false] (CLIENT)', DESC = 'Changes if antiteleport allows you to rejoin or not'} +CMDs[#CMDs + 1] = {NAME = 'allowrejoin / allowrj (CLIENT)', DESC = 'Toggles if antiteleport allows you to rejoin or not'} CMDs[#CMDs + 1] = {NAME = 'cancelteleport / canceltp', DESC = 'Cancels teleports in progress'} CMDs[#CMDs + 1] = {NAME = 'volume / vol [0-10]', DESC = 'Adjusts your game volume on a scale of 0 to 10'} CMDs[#CMDs + 1] = {NAME = 'antilag / boostfps / lowgraphics', DESC = 'Lowers game quality to boost FPS'} @@ -7867,24 +7867,19 @@ addcmd('clientantikick',{'antikick'},function(args, speaker) return notify('Incompatible Exploit','Your exploit does not support this command (missing hookmetamethod)') end local LocalPlayer = Players.LocalPlayer - local oldhmmi - local oldhmmnc - local oldKickFunction - if hookfunction then - oldKickFunction = hookfunction(LocalPlayer.Kick, function() end) - end - oldhmmi = hookmetamethod(game, "__index", function(self, method) - if self == LocalPlayer and method:lower() == "kick" then - return error("Expected ':' not '.' calling member function Kick", 2) - end - return oldhmmi(self, method) - end) - oldhmmnc = hookmetamethod(game, "__namecall", function(self, ...) - if self == LocalPlayer and getnamecallmethod():lower() == "kick" then - return - end - return oldhmmnc(self, ...) - end) + local oldNamecall; oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(...) + local method = getnamecallmethod and getnamecallmethod() or "" + if select(1, ...) == LocalPlayer and method == "Kick" or method == "kick" then + return nil + end + return oldNamecall(...) + end)) + hookfunction(LocalPlayer.Kick, newcclosure(function(self, _) + if self ~= lp then + error("Expected ':' not '.' calling member function Kick", 2) + end + return nil + end)) notify('Client Antikick','Client anti kick is now active (only effective on localscript kick)') end) @@ -7894,37 +7889,57 @@ addcmd('clientantiteleport',{'antiteleport'},function(args, speaker) if not hookmetamethod then return notify('Incompatible Exploit','Your exploit does not support this command (missing hookmetamethod)') end - local TeleportService = TeleportService - local oldhmmi - local oldhmmnc - oldhmmi = hookmetamethod(game, "__index", function(self, method) - if self == TeleportService then - if method:lower() == "teleport" then - return error("Expected ':' not '.' calling member function Kick", 2) - elseif method == "TeleportToPlaceInstance" then - return error("Expected ':' not '.' calling member function TeleportToPlaceInstance", 2) - end + + local oldTp; oldTp = hookfunction(TeleportService.Teleport, newcclosure(function(self, placeId, player, _teleportData, customLoadingScreen) + if checkcaller() or (allow_rj and placeId == game.PlaceId) then + return oldTp(self, placeId, player, _teleportData, customLoadingScreen) end - return oldhmmi(self, method) - end) - oldhmmnc = hookmetamethod(game, "__namecall", function(self, ...) - if self == TeleportService and getnamecallmethod():lower() == "teleport" or getnamecallmethod() == "TeleportToPlaceInstance" then + if self ~= TeleportService then + error("Expected ':' not '.' calling member function Teleport", 2) + end + if placeId == nil then + error("Argument 1 missing or nil", 2) + end + if typeof(placeId) ~= "number" and placeId ~= true then + error(`Unable to cast {typeof(placeId)} to int64`, 2) + elseif placeId == true then + -- somehow raise raiseTeleportInitFailedEvent return end - return oldhmmnc(self, ...) - end) + if typeof(customLoadingScreen) ~= "Instance" and customLoadingScreen ~= nil then + error("Unable to cast value to Object", 2) + end + return nil + end)) + hookfunction(TeleportService.TeleportAsync, newcclosure(function(self, placeId, players, teleportOptions) + if self ~= TeleportService then + error("Expected ':' not '.' calling member function TeleportAsync", 2) + end + if players == nil then + error("Argument 2 missing or nil", 2) + end + if typeof(players) ~= "table" then + error("Unable to cast value to Objects", 2) + end + error("TeleportUnknown must be called from a Server", 2) + end)) + local oldNamecall; oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(...) + local nmc = getnamecallmethod() + if select(1, ...) == TeleportService and nmc == "teleport" or nmc == "Teleport" or nmc == "TeleportToPlaceInstance" or nmc == "TeleportAsync" then + if checkcaller() or (allow_rj and select(2, ...) == game.PlaceId) then + return oldNamecall(...) + end + return + end + return oldNamecall(...) + end)) notify('Client AntiTP','Client anti teleport is now active (only effective on localscript teleport)') end) addcmd('allowrejoin',{'allowrj'},function(args, speaker) - if args[1] and args[1] == 'false' then - allow_rj = false - notify('Client AntiTP','Allow rejoin set to false') - else - allow_rj = true - notify('Client AntiTP','Allow rejoin set to true') - end + allow_rj = not allow_rj + notify("Client AntiTP", `Scripts now may{allow_rj and "" or " not"} make you rejoin the server`) end) addcmd("cancelteleport", {"canceltp"}, function(args, speaker)