|
| 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 |
|
|
|
| 20 Jan 2012 03:58 PM |
| game.CreatorId or something like that. Let me look it up. |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 20 Jan 2012 05:10 PM |
| Never heard of ClearAllChildren before. o: |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2012 05:11 PM |
It's relatively new. Came out with :Destroy()
"I WILL GIVE YOU BACON." - Deadmau5 ~Scarfacial |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 20 Jan 2012 05:15 PM |
| does it :Destroy() the children? or just :remove() them? |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2012 05:16 PM |
| It destroys all children as well. |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2012 05:17 PM |
| cool, thanks AFF, would it work just to do game:ClearAllChildren()? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 20 Jan 2012 05:21 PM |
On a side not, ClearAllChildren REMOVES the objects. It does NOT destroy them.
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 20 Jan 2012 05:49 PM |
| I dont think there is :o they do the exact same thing... |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2012 05:54 PM |
| Wow thanks for the help. O_O And I never heard of ClearAllChildren() just Destory() :P |
|
|
| Report Abuse |
|
|