Server Storage Not Detecting a valid Folder in it

So I am creating an Anti-Exploit and I have this configuration folder to add configs features like whitelisted Group and Rank and to enable or disable features like Anti-Fly or Anti-Godding in it, and there is a separate folder with BoolValues which is a folder called Settings in my Server Storage, but whenever I am running the script am seeing an error in the output, that is telling me.

Settings is not a valid member of ServerStorage

And am not understanding how that is even possible, here is my script which doesn’t allow the real anti exploit to be disabled.

local Players = game:GetService("Players")

local LocalPlayer = game.Players.LocalPlayer

local Player = game.Players:GetPlayers()

local RealAnti = script.Parent:WaitForChild("RealAnti")
local GroupID = game.ServerStorage.Settings.Config.GroupID

while wait() do
	if script.Parent:FindFirstChild("RealAnti") == nil then
		LocalPlayer:Kick("Nope") -- Change this nope to the kick message
	elseif Player:GetRankInGroup(GroupID) >= GroupID.GroupRank then
		RealAnti.Disabled = true
	elseif RealAnti.Disabled then
		RealAnti.Disabled = false	
	end
end

And here is the real big Anti Exploit Script

local Players = game:GetService("Players")

local LocalPlayer = game.Players.LocalPlayer

local Character = LocalPlayer.Character

local HRP = Character:WaitForChild("HumanoidRootPart")

local Backpack = LocalPlayer:WaitForChild("Backpack")
local Max_Speed = game.ServerStorage.Settings.Config.Max_Speed.Value
local Max_Health = game.ServerStorage.Settings.Config.Max_Health.Value

local NoDisabling = script.Parent:WaitForChild("NoDisabling")


repeat wait() until LocalPlayer
repeat wait() until LocalPlayer.Character

local Body = {

["BodyVelocity"] = true;
["BodyGyro"] = true;
["BodyPosition"] = true
 }

local Parts = {
	["Part"] = true;
	["Model"] = true;
	["MeshPart"] = true
}


local Objects = game.ServerStorage.Settings.Config.Not_Allowed_Items:GetChildren()

--No Speed
if game.ServerStorage.Settings.Features.Anti_Speed.Value == true then
	if Character.Humanoid.Walkspeed >= Max_Speed  then
		LocalPlayer:Kick("No Exploit")
	end
end


-- Anti part inserton
if game.ServerStorage.Settings.Features.Anti_PartInsertor.Value == true then
	game.Workspace.ChildAdded:Connect(function(Obj)
		if Parts[Obj.ClassName] then
			Obj:Destroy()
        end
    end)
end

-- Anti Lightning
if game.ServerStorage.Settings.Features.Anti_Lightning.Value == true then
	game.Lighting.ChildAdded:Connect(function(Obj)
	if Obj:IsA("Sky") then
		Obj:Destroy()
		end
	end)	
end

-- Backpack Control
if game.ServerStorage.Settings.Features.Backpack_Control.Value == true then
	Backpack.ChildAdded:Connect(function(Obj)
    if Obj:IsA(Objects.Name) or Obj:IsA("HopperBin") then
	LocalPlayer:Kick("No Exploiting")
end
end)
end

-- Anti Fly
if game.ServerStorage.Settings.Features.Anti_Fly.Value == true then
	HRP.ChildAdded:Connect(function(Obj)
		if Body[Obj.ClassName] then
			LocalPlayer:Kick("No Exploiting")
		end
		end)
end

-- Anti Humanoid Destroyer
if game.ServerStorage.Settings.Features.Anti_Humanoid_Destroyer.Value == true then
	Character.ChildRemoved:Connect(function(Obj)
		if Obj:IsA("Humanoid") then
			LocalPlayer:Kick("No Exploits")
		end
	 end)
end

-- Anti Health
if game.ServerStorage.Settings.Features.Anti_Health.Value == true then
	if Character.Humanoid.Health >= Max_Health then
		LocalPlayer:Kick("No Exploits")
	end
end

--Anti Teleportation
local PreviousPosition
if game.ServerStorage.Settings.Features.Anti_Teleportation.Value == true then
function NoTeleport()
	if HRP == nil then
		LocalPlayer:Kick("No Exploits")
	end
	local PositionFirst = HRP.Position
	delay(1, function()
		local PositionSecond = HRP.Position
		if(PositionSecond - PositionFirst).magnitude >= 140 then
			LocalPlayer:Kick("No Exploits")
		end
		end)
end
end


local Player = game.Players:GetPlayers()

while wait() do
	if Player:GetRankInGroup(game.ServerStorage.Settings.Config.GroupID) >= game.ServerStorage.Settings.Config.GroupID.GroupRank then
		NoDisabling.Disabled = true
	elseif NoDisabling.Disabled then
		NoDisabling.Disabled = false
	elseif script.Parent:FindFirstChild("RealAnti") == nil then
		LocalPlayer:Kick("Nope") 
	end
	NoTeleport()
end

Is this a possible bug? Or something wrong in my scripts? Because I have, for those who would say that I may have misspelt Settings, I haven’t.

I see you are using localplayer, which means you are doing stuff locally. You cannot view ServerStorage on the client, as it is secure and not replicated to the client. You will need to use remotes to communicate. Either that or expose it to replicated storage, but that is not safe.

The contents of ServerStorage are not replicated to the client. So the client cannot see it. Btw, exploiters can always remove the anti-exploit, so no point in trying to secure the client really.

Well what do you think I should do then? Where should I put what.

Well, if you put it in replicated storage, you can read the data from the client. That also exposes it to exploiters. Your benefit is that you wouldn’t have to program in remotes. Remotes would be a bit more secure as you could then access serverstorage, but the downside is you would have to rewrite your current script(s). Another thing is that anything on the client can be touched by an exploiter, so they can disconnect events, delete/disabled client scripts and find ways around it. The best way is to either create a conservative server-sided model as you must account for latency which may give false positives. (eg if they seem to be moving super fast, you can slow down their speed, but you shouldn’t kick them, as it might just be replication lag). In general, good anti exploits really prevent very specific types of exploiting. E.g shooter games might flag suspicious players for a game moderator to then review. I hope this helps.

2 Likes

Or what if I use configuration within my scripts?

You could do this, but make sure you are OK with exploiters seeing it. They can decompile local scripts. Understand that a lot of anti exploits are very easily bypassable, especially on the client, so make sure you are creating this for a very specific reason. Cheers.

1 Like

Mhm.

Thanks for the lovely help.