|
| 31 May 2016 03:24 PM |
I'm trying to make a verification system so a hacked client (person hacking on the client) can't just add things into the Workspace, however I'm running into a bit of trouble while sending over from the client to the server an Instance that was added to a folder in the Workspace, and comparing that with what the server finds in the folder, and seeing if it finds the Instance sent over from the client. However, the Server only sees the same thing, and nothing that was added even from the server.
Example: 3 things in folder when game starts Add 1 thing to folder from server Server doesn't see it, thinks client added it
Here is the code:
VU.OnServerInvoke = function(PLAYER, ARGS) local PARENT = ARGS[1] local UNIT = ARGS[2] local ADDED = ARGS[3] local TEAM_COLOR = PLAYER.TeamColor local TEAM = RS.GameData.Teams[tostring(TEAM_COLOR)] local UNITS = game.Workspace.UnitData[tostring(TEAM_COLOR)]:GetChildren() for _,v in pairs(UNITS) do print(v.Name) if (v == UNIT) then if (ADDED == true) then return true else return false end end if (ADDED == true) then return false else return true end end end
choo choo |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 03:40 PM |
"can't just add things into the Workspace"
This is why there's FE.
Me: "Are you proud of me?" Matthew: "No... I'm not." |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 03:41 PM |
Yes, however the client will still be able to interact with the things it adds, so I need a function to remove anything it adds.
choo choo |
|
|
| Report Abuse |
|
|
| |
|
Borsy
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 15111 |
|
|
| 31 May 2016 05:48 PM |
try adding wait(.345) to top of all scripts
ℋ𝓪 ℋ𝓪 𝓢𝓱𝓪𝓻𝒆 𝓘𝒇 𝓨𝓸𝓾 𝓐𝓰𝓻𝒆𝒆 😂😂😂😂 | originally Reset2378658 |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 05:54 PM |
It didn't do anything different.
choo choo |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 31 May 2016 05:59 PM |
:GetChildren() does return all children
This is going to be usage//implementation error. That code looks fine. |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 06:01 PM |
For some reason it is either not getting called every time the server is invoked, or it is just not returning all the children. I don't see why either one of those situations would happen.
choo choo |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 06:11 PM |
Even if this would work, a hacker can simplily "lie" about what it's creating. Now when the client would send the info, it would send a fake copy of a valid client workspace (one that's not hacked), and the real contents for that workspace would be a secret and no one would know. That way the server would "think" that the client is clean.
If you don't want the player to be able to interact with it's surronding (for example not being able tp walk across something) you could just monitor the client's movement from the server. If the client is walking on an invalid object (walking on nothing), then BAM. He's caught.
If you were'nt trying to see if the client was adding objects to it's own workspace (ex. local parts), well then I just wasted 90 seconds of you life! Hopefully this helped!
|
|
|
| Report Abuse |
|
|
|
| 31 May 2016 06:14 PM |
That wasn't the kind of interacting with things I was talking about. I'm currently making a remake of the Conquerors, and the kind of interacting I was talking about was people cloning in "dirty" buildings and using them to create troops.
choo choo |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 06:31 PM |
After further experimentation, it seems that the :GetChildren() method is only returning the first child added to the folder after it has been emptied. Either that or that is the only one being processed in the for loop.
choo choo |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 31 May 2016 06:33 PM |
for _,v in pairs(UNITS) do print(v.Name) if (v == UNIT) then if (ADDED == true) then return true else return false end end if (ADDED == true) then return false else return true end end
--// This segment guarantees that only the first object is processed. if (ADDED == true) then return false else return true end |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 06:35 PM |
How so? "This segment" only happens if "v == unit".
choo choo |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 06:36 PM |
Oh nevermind you were talking about the second one not the first one. Yes I realize now that "this segment" should be OUTSIDE the for loop...
choo choo |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 06:37 PM |
I thought it WAS outside the for loop, but apparently it wasn't.
choo choo |
|
|
| Report Abuse |
|
|
|
| 31 May 2016 06:41 PM |
@Casualist It works flawlessly now, and I thank you for catching that.
choo choo |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
| |
|