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)
The problem is that you're trying to access the CurrentCamera
from a Server-Side script. Only LocalScripts can access the CurrentCamera