Hello there! So a while ago i asked how to run a line of code when a player joins not when they die, and now i fixed that problem, but now my camera mover script broke because of that. I dont know what im doing wrong and i would help a lot if i could get some awnsers. Heres the script im currently using:
game.Players.PlayerAdded:Connect(function(player)
local tween = game:GetService(“TweenService”):Create(game.Workspace.Camera, TweenInfo.new(-1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, false, 0), {CFrame = (game.Workspace.fancyview.CFrame)})
tween:Play()
end)
Try keeping the line of code u wanted to run when the player joins using PlayerAdded and create another script using Character Added and insert the camera tweens there.
Adding on to what Reinellex said, all you would have to do to fix it is by adding the CharacterAdded event like so:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function() --adding any parameter here would just give you the player's character
--code here
end)
end)