OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 14 Nov 2016 07:36 PM |
--*** means D-a-t-a-S-t-o-r-e, it's censored out by Roblox. --For some reason, if someone on the GroupTeam rejoins a server, they don't respawn with their weapons or their Prisoner bool value. Please help and tell me if I miss anything. Good luck! Thanks in advance.
local *** = game:GetService("***Service"):Get***("JailedList")
local playerName
local allyTeam = "Allies"--Name of the team for the allies local allySpawn = "AllySpawn"--Name of the spawn for allies local allyWeapons = {"AllySabre"}--List of weapons for the allies local allyID = 0--ID of an ally group
allyTeam = game.Teams:FindFirstChild(allyTeam) allySpawn = game.Workspace:FindFirstChild(allySpawn)
local citizenTeam = "Citizens"--Name of the team for citizens (A#######################i############ "C####################f the spawn for citizens local citizenWeapons = {}--List of weapons for the citizens
citizenTeam = game.Teams:FindFirstChild(citizenTeam) citizenSpawn = game.Workspace:FindFirstChild(citizenSpawn)
local hostileTeam = "Hostiles"--Name of the team for hostiles local hostileSpawn = "HostileSpawn"--Name of the spawn for hostiles local hostileWeapons = {"HostileSabre"}--List of weapons for the hostiles local hostileID = 0--ID of a hostile group
hostileTeam = game.Teams:FindFirstChild(hostileTeam) hostileSpawn = game.Workspace:FindFirstChild(hostileSpawn)
local prisonerTeam = "Prisoners"--Name of the team for prisoners local prisonerSpawn = "PrisonerSpawn"--Name of the spawn for prisoners
prisonerTeam = game.Teams:FindFirstChild(prisonerTeam) prisonerSpawn = game.Workspace:FindFirstChild(prisonerSpawn)
local groupTeam = "The Lumiere Paladins"--Name of the team for the main group local groupSpawn = "TLPSpawn"--Name of the spawn for the main group local groupBasicWeapons = {"TLPSabre"}--List of weapons for the main group local groupAdvancedWeapons = {"Handcuffs"}--List of weapons for the main group local groupID = 2980186--ID of the main group local lowRank = 5--Rank in group you need to be to be in the group team and have basic group weapons local highRank = 230--Rank in group you need to have advanced group weapons
groupTeam = game.Teams:FindFirstChild(groupTeam) groupSpawn = game.Workspace:FindFirstChild(groupSpawn)
game.Players.PlayerAdded:connect(function(player) playerName = player.Name player.TeamColor = citizenTeam.TeamColor if player:IsInGroup(allyID) then player.TeamColor = allyTeam.TeamColor player.Character.Torso.CFrame = CFrame.new(allySpawn.Position) end if player:GetRankInGroup(groupID) >= lowRank then player.TeamColor = groupTeam.TeamColor player.Character.Torso.CFrame = CFrame.new(groupSpawn.Position) end if player:IsInGroup(hostileID) then player.TeamColor = hostileTeam.TeamColor player.Character.Torso.CFrame = CFrame.new(hostileSpawn.Position) end -------------works till here for group team, works entirely for everyone else player:WaitForDataReady() local key = "player_" .. player.userId or 0 local prisoner = Instance.new("BoolValue", player) prisoner.Name = "Prisoner" prisoner.Value = ***:GetAsync(key) if prisoner.Value == true then player.TeamColor = prisonerTeam.TeamColor player.Character.Torso.CFrame = CFrame.new(prisonerSpawn.Position) end if player.TeamColor == groupTeam.TeamColor and player.Prisoner.Value == false then if player:GetRankInGroup(groupID) >= highRank and #groupAdvancedWeapons > 0 then for i = 1, #groupAdvancedWeapons do local clone1 = game.ServerStorage:WaitForChild(groupAdvancedWeapons[i]):Clone() clone1.Parent = player.StarterGear local clone2 = game.ServerStorage:WaitForChild(groupAdvancedWeapons[i]):Clone() clone2.Parent = player.Backpack end end if player:GetRankInGroup(groupID) >= lowRank and #groupBasicWeapons > 0 then for i = 1, #groupBasicWeapons do local clone1 = game.ServerStorage:WaitForChild(groupBasicWeapons[i]):Clone() clone1.Parent = player.StarterGear local clone2 = game.ServerStorage:WaitForChild(groupBasicWeapons[i]):Clone() clone2.Parent = player.Backpack end end elseif player.TeamColor == allyTeam.TeamColor and #allyWeapons > 0 then for i = 1, #allyWeapons do local clone1 = game.ServerStorage:WaitForChild(allyWeapons[i]):Clone() clone1.Parent = player.StarterGear local clone2 = game.ServerStorage:WaitForChild(allyWeapons[i]):Clone() clone2.Parent = player.Backpack end elseif player.TeamColor == hostileTeam.TeamColor and #hostileWeapons > 0 then for i = 1, #hostileWeapons do local clone1 = game.ServerStorage:WaitForChild(hostileWeapons[i]):Clone() clone1.Parent = player.StarterGear local clone2 = game.ServerStorage:WaitForChild(hostileWeapons[i]):Clone() clone2.Parent = player.Backpack end elseif player.TeamColor == citizenTeam.TeamColor and #citizenWeapons > 0 then for i = 1, #citizenWeapons do local clone1 = game.ServerStorage:WaitForChild(citizenWeapons[i]):Clone() clone1.Parent = player.StarterGear local clone2 = game.ServerStorage:WaitForChild(citizenWeapons[i]):Clone() clone2.Parent = player.Backpack end end end)
game.Players.PlayerRemoving:connect(function(player) local key = "player_" .. player.userId or 0 local valueToSave = (player.Prisoner.Value) ***:SetAsync(key, valueToSave) end)
--Online |
|
|
| Report Abuse |
|
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 14 Nov 2016 07:56 PM |
I'm a little bit disappointed. Why isn't anyone responding?
--Online |
|
|
| Report Abuse |
|
|
Thedagz
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 798 |
|
| |
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 14 Nov 2016 08:09 PM |
I can't check because you can't rejoin a server in studio's testing mode.
--Online |
|
|
| Report Abuse |
|
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
| |
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
| |
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
| |
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
| |
|
|
| 14 Nov 2016 08:33 PM |
| People dont tend to respond when you give them tons of code to read through and dont even give hint of where to look |
|
|
| Report Abuse |
|
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 15 Nov 2016 07:22 PM |
I would show less code if I could, but I have no idea where it goes wrong. Bump.
--Online |
|
|
| Report Abuse |
|
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
| |
|