This is my code, so when I check in Client it works, the trouble is at ‘Folder’ It says Infinite Yield on Replicated Storage for waiting the squad owner name.
Here you can see, the value is true, everything’s perfect, tweening GUI but… https://gyazo.com/530e653b4fcf823a88604062d39a7582
it’s not giving billboard gui,
The funny part, is that, first off folder exixts.
second: https://gyazo.com/eede7ff628305e3155ddf6e249b9f79a Here i’m checking clientsided the value, but for some reason, the local script is getting the value as nil
WHAT IT SHOULD DO:
Basically, give billboard gui to player, but looks like if the SquadLeader.Value was nil
Player["Status"]:FindFirstChild("InSquad").Changed:Connect(function(value)
if value == true then
script.Parent.OnSquad:TweenPosition(UDim2.new(0,0,0,0), "Out", "Quad", 1, true)
print("Changed")
local Folder = game.ReplicatedStorage:WaitForChild(Player.Status.SquadLeader.Value.."-Squad")
ClearTags()
if Folder then
print('Folder~')
for i,v in ipairs(Folder:GetChildren()) do
print(v.Name)
if v ~= Player.Name then
local Template = script:FindFirstChildWhichIsA("BillboardGui"):Clone()
Template.Name = v.Name
Template.Adornee = workspace:FindFirstChild(v.Name:WaitForChild('Head'))
Template.Parent = script.Parent.Teamtags
end
end
end
elseif value == false then
ClearTags()
script.Parent.OnSquad:TweenPosition(UDim2.new(-1,0,0,0), "Out", "Quad", 1, true)
end
end)
game.ReplicatedStorage.OOP.AddToSquad.OnServerEvent:Connect(function(plr, Target)
if Target then
if game.ReplicatedStorage[plr.Name.."-Squad"]:FindFirstChild(Target.Name) then return end
if Target['Status']['InSquad'].Value == false then
game.ReplicatedStorage.OOP.AddToSquad:FireClient(Target, plr)
end
end
end)
CLIENT:
game.ReplicatedStorage.OOP.AddToSquad.OnClientEvent:Connect(function(TheOneAsking)
print(TheOneAsking.Name)
script.Parent.SquadPrompt.ViewGuns:TweenPosition(UDim2.new(0.405, 0,0.092, 0), "Out", "Quad", 1, true)
script.Parent.SquadPrompt.ViewGuns.TextLabel.Text = "Hey "..Player.Name.." would you like to join "..TheOneAsking.Name.." squad?"
end)
The InSquad is set, then your code runs, but it reaches the if statement before SquadLeader is set, so it appears as nil. Perhaps try swapping round those two: