generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Anti-Hack

Previous Thread :: Next Thread 
Catpwnszer is not online. Catpwnszer
Joined: 26 Nov 2010
Total Posts: 631
20 Jan 2012 03:57 PM
I'm going to make a anti-hack script. How can I script tell who the owner of the game is? I really need to know!
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
20 Jan 2012 03:58 PM
game.CreatorId or something like that. Let me look it up.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
20 Jan 2012 04:01 PM
Yup. game.CreatorId
Report Abuse
mgpmaddgear is not online. mgpmaddgear
Joined: 19 Jan 2011
Total Posts: 7
20 Jan 2012 05:03 PM
you should put this in the startergui or starterpack, then it will trigger when a player enters :3:

id = yourId
if game.CreatorId~=id then
--would game:ClearAllChildren() work instead of making all these lines?
game.Lighting:ClearAllChildren()
game.StarterGui:ClearAllChildren()
game.StarterPack:ClearAllChildren()
game.Workspace:ClearAllChildren()
end
Report Abuse
mgpmaddgear is not online. mgpmaddgear
Joined: 19 Jan 2011
Total Posts: 7
20 Jan 2012 05:04 PM
sorry, i thought i was on my account, but im on my cousins :o this isbluey speaking right now. im going to put up an anti hack script on my models when i log into my account!
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
20 Jan 2012 05:10 PM
Never heard of ClearAllChildren before. o:
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
20 Jan 2012 05:11 PM
It's relatively new.
Came out with :Destroy()

"I WILL GIVE YOU BACON." - Deadmau5
~Scarfacial
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
20 Jan 2012 05:14 PM
this is fairly effective to help prevent place stealing. just make sure to have the script nice and hidden.

repeat wait()until game:findFirstChild("NetworkServer")
if game.CreatorId ~= 2143630 then
Instance.new('ManualSurfaceJointInstance',Workspace)
end

speaking of which, i heard something about parenting scripts to nil and they still run if that true?

~I've been to nil and back.
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
20 Jan 2012 05:15 PM
Anything else that came out with it? I don't see release info, and I haven't been active lately...
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
20 Jan 2012 05:15 PM
does it :Destroy() the children? or just :remove() them?
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
20 Jan 2012 05:16 PM
It destroys all children as well.
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
20 Jan 2012 05:17 PM
cool, thanks AFF, would it work just to do game:ClearAllChildren()?
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
20 Jan 2012 05:19 PM
Oh, if you were asking about ClearAllChildren I have no idea.
Sorry.

Let me see if I can't find out.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
20 Jan 2012 05:19 PM
"game.Workspace:ClearAllChildren()"

Will error, because of the terrain object.

Here is a better way to do it:

function clean(object)
   pcall(function() object:Destroy() end)
   local _, children = pcall(function() return object:GetChildren() end) -- Because of some locked services like the CoreGui.
   if type(children) == 'userdata' then
      for _, child in pairs(children) do
         clean(child)
      end
   end
end

clean(game)
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
20 Jan 2012 05:21 PM
On a side not, ClearAllChildren REMOVES the objects. It does NOT destroy them.

Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
20 Jan 2012 05:21 PM
@jul, i noticed it. but it seemed to detroy the other parts anyway lol :P im gonna run a different test XD
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
20 Jan 2012 05:21 PM
"does it :Destroy() the children? or just :remove() them?"

Neither. It just parents all the children to nil and calls itself on each of them.

Basically, it parents every descendant to nil. It uses neither Destroy, neither Remove.

"cool, thanks AFF, would it work just to do game:ClearAllChildren()?"

That'd error because all the game services are locked.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
20 Jan 2012 05:24 PM
@Julien

Is there really a difference between Remove and parenting to nil? If so, what is it? >_<
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
20 Jan 2012 05:24 PM
destroy*

it just gives a warning that terrain is locked, now that i think of it I should add Workspace.Terrain:Clear()
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
20 Jan 2012 05:36 PM
"Is there really a difference between Remove and parenting to nil? If so, what is it? >_<"

There is. And a big one.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
20 Jan 2012 05:44 PM
I love how you don't seem to answer all of my questions. Ever.

If there's such a big difference, what the heck is it?
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
20 Jan 2012 05:49 PM
I dont think there is :o they do the exact same thing...
Report Abuse
Catpwnszer is not online. Catpwnszer
Joined: 26 Nov 2010
Total Posts: 631
22 Jan 2012 05:54 PM
Wow thanks for the help. O_O And I never heard of ClearAllChildren() just Destory() :P
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image