print("f")
local players = game:GetService("Players")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local regiments = {
{TAG = "PATROL", ID = 5786049},
{TAG = "RGR", ID = 5310724},
{TAG = "UKSF", ID = 5029915},
{TAG = "RMP", ID = 4972920},
{TAG = "RGG", ID = 4973182},
{TAG = "ETS", ID = 5237367},
{TAG = "BOP", ID = 4994558},
{TAG = "PARAS", ID = 4973512},
{TAG = "AAC", ID = 5310715},
{TAG = "RAMC", ID = 5310746},
{TAG = "JA", ID = 5310728},
{TAG = "RIC", ID = 5216554},
{TAG = "CRE", ID = 5310751}
}
local function isin(player,id)
if player:IsInGroup(id) then
print("you are in"..id)
return true
end
end
print("check1")
local function get_regiments(player)
local player_regiments = {}
for i = 1,#regiments do
local rg = regiments[i]
if isin(player,rg.ID) then
table.insert(player_regiments,rg)
print(rg)
end
end
return player_regiments
end
print("check2")
local playerhead = char:WaitForChild("Head",math.huge)
local localcolor = player.TeamColor.Color
local plrregiments = get_regiments(player)
local strname = ""
if player:IsInGroup(4972535) then
print("before1")
local splitrank = player:GetRoleInGroup(4972535):split(" ")
table.remove(splitrank,1)
for i = 1,#splitrank do
strname = strname..splitrank[i].." "
end
else
strname = "Civilian"
end
local strreg = ""
if player:GetRankInGroup(4972535) < 22 then
if #plrregiments > 1 then
for i = 1,#plrregiments do
if i < #plrregiments then
strreg = strreg.."["..plrregiments[i].TAG.."] - "
else
strreg = strreg.."["..plrregiments[i].TAG.."]"
end
end
elseif #plrregiments == 1 then
strreg = "["..plrregiments[1].TAG.."] - "..player:GetRoleInGroup(plrregiments[1].ID)
else
if player:IsInGroup(4972535) then
strreg = "Enlisted Personnel"
else
strreg = "Civilian"
end
end
else
strreg = "HEADQUARTERS"
print("check3")
end
print(strreg)
if (player:GetRankInGroup(4780049) >= 246) then
strreg = strreg.."["..player:GetRoleInGroup(4780049).."]"
end
if (player:GetRankInGroup(5000086) >= 246) then
strreg = strreg.."["..player:GetRoleInGroup(5000086).."]"
end
if(player.UserId == 1108228838) then
strreg = "BA | Creator Program âď¸"
end
print("Changed")
script.Parent.Parent.Landing.Player_Info.Regiment.Text = strreg
So I have this script which I debugged but it works perfectly in studio but not in game, any idea what might cause it?
Thank you for your time