I'm attempting to make this script where the local Brick's BillboardGui's Frame will resize based on their position, so no matter where they are, they'll be able to see it. Line 20 never seems to work. Without all of the extra work, I'd see the part fine. I tried to use coroutine (Not sure if I should. First time using it), but it doesn't fire/I don't know it doesn't due to me not seeing the brick.
local Sizing = coroutine.wrap(function()
pl = game.Players.LocalPlayer
c = game.Workspace.CurrentCamera
s = c.Part
f = c.Rank.Frame
old = 0
while true do
if (old < (pl.Character.Torso.Position - s.Position).magnitude) then
f.Size = f.Size + Vector3.new(.1,0,.1,0)
old = (pl.Character.Torso.Position - s.Position).magnitude
elseif (old > (pl.Character.Torso.Position - s.Position).magnitude) then
f.Size = f.Size + Vector3.new(.1,0,.1,0)
old = (pl.Character.Torso.Position - s.Position).magnitude
end
end
end)
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
game.Lighting.Part:clone().Parent = game.Workspace.CurrentCamera
Sizing()
end)
end)

3 comments
This is a LocalScript. Any tips?
remove the PlayerAdded and the CharacterAdded events so that those commands will execute no matter what
Thanks. I have another problem, but I'll make it a new question.