I don't want people to be able to edit the workspace (By this I mean ingame, and by exploiters). How could I go about this?
Possible code:
previousWorkspace = {} newWorkspace = {} function checkWorkspace() for i,v in pairs(workspace:GetChildren()) do table.insert(previousWorkspace, v.Name) end end function compare() for i,v in pairs(previousWorkspace) do for ii,vv in pairs(newWorkspace) do if v == vv then return true end end end end while true do if compare() then -- ?? What next ?? else -- Extra Code end end
Please help! I DO NOT WANT TO USE FE!!!
Well you could do this:
previousWorkspace = {} newWorkspace = {} function checkWorkspace() for i,v in pairs(workspace:GetChildren()) do table.insert(previousWorkspace, v.Name) end end game.Workspace.ChildAdded:connect(function() -- If something was added to the workspace for i,v in pairs(previousWorkspace) do for ii,vv in pairs(newWorkspace) do if v == vv then return true else vv:Destroy() -- Would destroy anything new added end end end end() game.Workspace.ChildRemoved:connect(function() -- If something was removed from the workspace for i,v in pairs(previousWorkspace) do for ii,vv in pairs(newWorkspace) do if v == vv then return true else local reAdd = v:Clone() -- then try to find the things last parent. end end end end()
I mean this could be one way to go about it. This isn't the best way to go about this but, I do hope it kind of pointed you in the right direction.