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: Group Role Specific Kick

Previous Thread :: Next Thread 
BeardActual is not online. BeardActual
Joined: 29 Nov 2008
Total Posts: 57
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 is not online. 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
BeardActual is not online. BeardActual
Joined: 29 Nov 2008
Total Posts: 57
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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
23 Mar 2014 10:49 PM
why would you want to kick the owner of a group..?
Report Abuse
BeardActual is not online. BeardActual
Joined: 29 Nov 2008
Total Posts: 57
23 Mar 2014 10:49 PM
It's just an example rank.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
23 Mar 2014 10:50 PM
if Player:GetRankInGroup(878976) == 255 then

simple :p..
Report Abuse
BeardActual is not online. BeardActual
Joined: 29 Nov 2008
Total Posts: 57
23 Mar 2014 10:50 PM
Any idea's why it's not working?
Report Abuse
maxomega3 is not online. 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
BeardActual is not online. BeardActual
Joined: 29 Nov 2008
Total Posts: 57
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 is not online. 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 is not online. 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
BeardActual is not online. BeardActual
Joined: 29 Nov 2008
Total Posts: 57
23 Mar 2014 10:56 PM
Yea I switched it to GetRank and now it works, Gracias Gentlemen.
Report Abuse
maxomega3 is not online. 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
LastThoughts is not online. LastThoughts
Joined: 23 Dec 2013
Total Posts: 2811
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 is not online. 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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
23 Mar 2014 11:03 PM
either use :Destroy() or :Kick()
never,EVER use :Remove()..k
Report Abuse
Bebee2 is not online. 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 is not online. 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 is not online. 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 is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
23 Mar 2014 11:06 PM
Remove < Every other method of destroying something
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
23 Mar 2014 11:06 PM
^Truth
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
23 Mar 2014 11:07 PM
if (Remove == WorstWayToDestroyThings) then
print "yep!"
end

output:

-yep!
Report Abuse
Bebee2 is not online. 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 is not online. 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 is not online. 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
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