Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

why won't my script work?

Asked by
Prioxis 673 Moderation Voter
10 years ago

whenever I go to test my script and I do play solo nothing happens

heres my script

local camera = game.Workspace.CurrentCamera
wait(5)
game.Players.PlayerAdded:connect(function(player)
    camera.CameraType = "Scriptable"
    camera.CoordinateFrame = CFrame.new(121, 14, 16)
    wait()
end)

1 answer

Log in to vote
1
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

When on play solo mode, your player loads faster than the script does so your player is already added by the time it starts searching for it. The wait you put into the script may also effect how well this functions. If the player is loaded before function is called then it will not return as a PlayerAdded.

The wiki has a solution to this problem here.

Ad

Answer this question