|
| 23 Mar 2014 10:46 PM |
I'm trying to make it so that if a player in a group in a specific role gets kicked when entering the server.
Here is what I have so far.
game.Players.PlayerAdded:connect(function(Player) if Player:GetRoleInGroup(878976) == 255 then Player:Kick() end end)
Don't really know what else I can do. or why it's not working. |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Mar 2014 10:47 PM |
| Role is the name of the position. Rank is the number. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 10:49 PM |
Then how would the script tell which group?
I used this as a basis. http://wiki.roblox.com/index.php?title=GetRankInGroup_(Method)
Then modified it. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 10:49 PM |
| why would you want to kick the owner of a group..? |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 10:49 PM |
| It's just an example rank. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 10:50 PM |
if Player:GetRankInGroup(878976) == 255 then
simple :p.. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 10:50 PM |
| Any idea's why it's not working? |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Mar 2014 10:51 PM |
| Like I said: The ROLE is the name of the rank, and the RANK is the number of the rank that 255 is. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 10:53 PM |
| So I just put the role name, instead of the group ID, and the role ID where 255 is? |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Mar 2014 10:54 PM |
| Well, depends on the case. If you are not sure what the rank is because you're not an admin in said group, then you can use role. But since your format already uses the rank, then you should use the :GetRankInGroup method. |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 23 Mar 2014 10:55 PM |
Wait, Player:Kick() is valid? All this time I've been removing them from Players... |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 10:56 PM |
| Yea I switched it to GetRank and now it works, Gracias Gentlemen. |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Mar 2014 10:56 PM |
| Yeah, Kick is actually better, because it freezes the game and declares it has shut down, so the player can't linger. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 10:58 PM |
-- tell me if this works game.Players.PlayerAdded:connect(function(Player) if Player:GetRankInGroup(878976) == 255 then Player:remove() -- there are easy free model crash scripts out there end end) -- there ya go! |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Mar 2014 11:01 PM |
| ^That will work, but :remove () is the absolute worst method of doing that. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2014 11:03 PM |
either use :Destroy() or :Kick() never,EVER use :Remove()..k |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 23 Mar 2014 11:03 PM |
| You could ATLEAST use destroy so the hacker cannot set their parent back to Players despite that never happens. |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 23 Mar 2014 11:04 PM |
Dear islandmaker2012,
remove() has one advantage over destroy()
remove sets the parent to nil and does NOT lock them
Therefor, events still run, you can retrieve them again, and still manipulate them. |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Mar 2014 11:06 PM |
| No, first of all, that is DEFINATELY not what you would want to use that for. Second of all, using .Parent = nil is still a better method. |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 23 Mar 2014 11:06 PM |
| Remove < Every other method of destroying something |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
| |
|
|
| 23 Mar 2014 11:07 PM |
if (Remove == WorstWayToDestroyThings) then print "yep!" end
output:
-yep! |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 23 Mar 2014 11:12 PM |
Maxi dude,
Remove and setting parent to nil is the same thing.
I use remove A LOT in inventory systems when storing items, and it is better than destroy in that instance because the item is not locked so I can make its parent back to workspace.
Destroy is superior for the fact it locks items and destroy their events, but remove is useful for the opposite reason of that. |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 23 Mar 2014 11:14 PM |
Ex.
local part = Instance.new'Part' print(part.Parent) part.Parent = workspace print(part.Parent) part:remove() part.BrickColor = BrickColor.random() print(part.Parent) part:Destroy() print(part.Parent) part.Parent = workspace
|
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Mar 2014 11:14 PM |
cntkillme said .Parent = nil was better, and I've come to the conclusion that he is a scripting genius.
Also, :Remove () is depreciated, and .Parent = nil can never be, so :P |
|
|
| Report Abuse |
|
|