Flexes
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 1584 |
|
|
| 30 Dec 2015 11:45 PM |
There's a NumberValue in the Team that represents the GroupID. If a player in the team isn't in the group, they are to be kicked out from the game. I attempted to code this, but it seems not to be working. Any helps?
** Script in Workspace **
for _, v in pairs (game:GetService("Teams"):GetTeams()) do for _, s in pairs (game:GetService("Players"):GetPlayers()) do while true do if s:IsInGroup(v.Group.Value) then s.Humanoid.Health = 100 else s:remove() end end end end
|
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 11:47 PM |
| It's game.Players:GetPlayers() |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 11:50 PM |
| It's s.Character.Humanoid.Health |
|
|
| Report Abuse |
|
|
Incrility
|
  |
| Joined: 11 Sep 2014 |
| Total Posts: 161 |
|
|
| 30 Dec 2015 11:54 PM |
local HR_Rank = 9 -- set to 0 if you want any member in the group to stay in game
game.Players.PlayerAdded:connect(function(Plyr) local HRTeam = game.Teams:FindFirstChild("High Ranks") if Plyr:IsInGroup(groupId) or Plyr.Name == "" then local rank = Plyr:GetRankInGroup(groupId) if rank >= HR_Rank then print 'LOL!' else Plyr.remove() end end end)
|
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 11:54 PM |
| You also have an infinite loop |
|
|
| Report Abuse |
|
|
Flexes
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 1584 |
|
|
| 30 Dec 2015 11:56 PM |
@Incri
Yes, thank you. But the problem is, how would I do this to multiple teams? Each team has their own NumberValue for their Group ID. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 11:56 PM |
| @Incri :remove() not .remove() |
|
|
| Report Abuse |
|
|
Flexes
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 1584 |
|
|
| 30 Dec 2015 11:59 PM |
| How can you make it so it repeatedly checks if the player is in the Group? |
|
|
| Report Abuse |
|
|
Flexes
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 1584 |
|
| |
|
|
| 31 Dec 2015 12:11 AM |
My god you are all morons(op isnt but he just cant script)
Anyway
game.Players.PlayerAdded:connect(function(player) if player:IsInGroup(ID) then player.TeamColor = BrickColor.new("Really Red") elseif player:IsInGroup(ID2) then player.TeamColor = BrickColor.new("Really Blue") else player:Kick() end
|
|
|
| Report Abuse |
|
|
|
| 31 Dec 2015 12:12 AM |
| Basicly when they join it will first check if they are in group1, and if they are put them on that team, if they are in group 2 they will be put in team2, if they are in neither they will be kicked |
|
|
| Report Abuse |
|
|
Flexes
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 1584 |
|
|
| 31 Dec 2015 12:22 AM |
Could that work? I just need it to repeat. This script is for exploiters. You know how they use Cheat Engine to change their User ID to a different User ID and they can change their teams? I would like so that when they're on the team and they're not in the certain group for it they get kicked. That's what i'm trying to do.
game.Players.PlayerAdded:connect(function(player) if player:IsInGroup(ID) and player.TeamColor = BrickColor.new("Bright blue") then print("Safe") elseif player:IsInGroup(ID2) and player.TeamColor = BrickColor.new("Bright red") then print("Safe") else player:Kick() end |
|
|
| Report Abuse |
|
|
Flexes
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 1584 |
|
|
| 31 Dec 2015 12:23 AM |
| I'm not trying to make it so it'll automatically put them on the team. It's just a security check script. |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2015 12:23 AM |
| They would get kicked before any "hacking" could be done, and even if they "hacked" in looping wouldnt do anything |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 31 Dec 2015 12:24 AM |
| Why do people state that their broken code is simple? If it's simple then stop asking us to fix it and do it yourself. |
|
|
| Report Abuse |
|
|
Flexes
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 1584 |
|
|
| 31 Dec 2015 12:24 AM |
| At least I gave it a try right? People just request for things to be scripted. |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2015 12:24 AM |
| ^Quite, its simple to others but to them its hard beacuase they are new to scripting |
|
|
| Report Abuse |
|
|
| |
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 31 Dec 2015 12:28 AM |
| You don't learn by asking others' to do your work. |
|
|
| Report Abuse |
|
|
Flexes
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 1584 |
|
|
| 31 Dec 2015 12:29 AM |
I asked for help. As you can see, I posted a code that I ATTEMPTED to do. I didn't ask to redo the whole entire thing? I asked what should I do to make it work.
Learn to read. |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2015 12:31 AM |
| Drah OP did EXACTLY what he was suppose to do. He attempting his best but fell short, so he asked for help. |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 31 Dec 2015 12:32 AM |
| Whoa now, don't start insulting me, my friend. Yes, you attempted to, and yes, you did ask for help when you got stuck, but did you do research before posting the question? How many times did you attempt to fix the code before posting the question? |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2015 12:33 AM |
| He's been rude to you, he hasn't insulted you. |
|
|
| Report Abuse |
|
|
Flexes
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 1584 |
|
|
| 31 Dec 2015 12:33 AM |
I've looked through open-sourced code, if that's what you call research.
& You're not doing any help so I'll just ignore you. |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 31 Dec 2015 12:36 AM |
Notice how he ignored my other question, about how many times he attempted to fix his code. I would defiantly help if I saw that he asked for such help on proper terms. |
|
|
| Report Abuse |
|
|