All you need is a check that the player exists.
As you're using a server script, we wait for script.Parent.Parent
to be a Player
.
01 | repeat wait() until script.Parent.Parent.ClassName = = "Player" |
02 | local player = script.Parent.Parent |
04 | rf = game.ReplicatedFirst |
05 | rs = game.ReplicatedStorage |
06 | vc = game.Workspace.Views |
08 | repeat wait() until player.Character |
10 | game.Workspace.CurrentCamera.CameraSubject = vc.V 1 |
11 | game.Workspace.CurrentCamera.CameraType = "Scriptable" |
12 | game.workspace.Camera.CoordinateFrame = vc.V 1. CFrame |
14 | player.CameraMaxZoomDistance = 25 |
15 | player.Character.Humanoid.Name = "Humanoid_" |
18 | local a = rs.Theme:Clone() |
19 | a.Parent = game.Workspace.CurrentCamera |
22 | local a = rf.EnterGui:Clone() |
23 | a.Parent = player.PlayerGui |
29 | a.Background_Frame.TextLabel.TextTransparency = n |
36 | a.Background_Frame.TextLabel.TextTransparency = n |
43 | a.Logo_ImageLabel.ImageTransparency = n |
49 | a.Background_Frame.BackgroundTransparency = n |