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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Script Checking (Involves groups)

Previous Thread :: Next Thread 
chimo88 is online. chimo88
Joined: 20 Aug 2008
Total Posts: 2051
27 Dec 2013 08:39 PM
--Do you see any errors?

local legion1 = 564624
local legion2 = 993775
local legion3 = 931042
local legion4 = 895767
--[[local division1 = 564624
local division2 = 993775
local division3 = 931042
local division4 = 895767
--]]
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:wait()
if player:GetRoleInGroup(333620) < 45 then
if player:IsInGroup(legion1) and player:IsInGroup(legion2) or
player:IsInGroup(legion1) and player:IsInGroup(legion3) or
player:IsInGroup(legion1) and player:IsInGroup(legion4) or
player:IsInGroup(legion2) and player:IsInGroup(legion3) or
player:IsInGroup(legion4) and player:IsInGroup(legion3) then
game.Workspace.CommChannels.CH1.Value = Player.Name.." is in 2 divisions, removed."
Player:Destroy()

end
end
end)

--Thanks!!
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
27 Dec 2013 08:43 PM
if you just want to check if he is in 2 divisions, use a loop.

divisions = {
legion1 = 564624,
legion2 = 993775,
legion3 = 931042,
legion4 = 895767,
}

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:wait()
if player:GetRoleInGroup(333620) < 45 then
local _ = 0
for i,v in pairs(divisions) do
if player:IsInGroup(v) then
_ = _ + 1
end
end
if _ >= 2 then
game.Workspace.CommChannels.CH1.Value = Player.Name.." is in 2 divisions, removed."
player:Destroy()--player was capitilized
end
end
end)

Report Abuse
chimo88 is online. chimo88
Joined: 20 Aug 2008
Total Posts: 2051
27 Dec 2013 08:44 PM
Why thank you friend! :)
Report Abuse
chimo88 is online. chimo88
Joined: 20 Aug 2008
Total Posts: 2051
27 Dec 2013 08:49 PM
Sadly it doesn't seem to work, either. Maybe I use getrank instead of getrole..?
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