part = Instance.new("Part") part.Size = Vector3.new(1,1,1) part.Anchored = true part.CanCollide = false part.Locked = true light = Instance.new("PointLight") light.Parent = part light.Range = 20 light.Brightness = 10 part.Parent = game.Workspace while true do part.CFrame = game.Workspace.CurrentCamera.CoordinateFrame wait() end
i have that but it has nothing in the output and nothing happens... Is this how i would do this?
EDIT its in a LocalScript
game.Players.PlayerAdded:connect(function(player) --Fires when a new player joins part = Instance.new("Part") --Makes the part part.Size = Vector3.new(1,1,1) --Re-sizes the shape to 1,1,1 part.Anchored = true -- Makes the part Anchored (so it can't move until you move/change your camera.) part.CanCollide = true -- You can walk trough it -- part.Locked = true -- Commented this out as it is not needed part.Transparency = 1 --Makes it so you can't see it light = Instance.new("PointLight") -- Creates the PointLight light.Parent = part -- Turns the parent of the light.Range = 20 --How far you can see the light light.Brightness = 10 -- How bright the light is part.Parent = game.Workspace --Moves the part to workspace so you can see it after() -- Fires the after function end) -- End of function function after() -- The After function begin while true do -- Makes it so it goes forever in this case as long as you dont delete the part part.CFrame = game.Workspace.CurrentCamera.CoordinateFrame -- Uses the current camera to show where the light will be wait() -- Waits half the time of wait(0) then does it all over end -- End of while true do code block end -- End of function
I commented every section so you can hopefully see what changes I made to see what fixed it :D