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

Why does this only work the first time the player spawns but not after that?

Asked by 9 years ago

This script is supposed to make it so when someone (re)spawns it makes their camera go to the character selection room but it only works the first time they spawn! Not respawn!

here is my script

gravityPercent = 50

game:GetService("Players").PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function()
Workspace.Camera.CameraSubject = script.Parent.CameraPart
end)
end) 

Please help!!! Thank you!!! [Edit] Forgot to put script up there!!! So sorry!

2 answers

Log in to vote
0
Answered by
Wizzy011 245 Moderation Voter
9 years ago

The script should change CurrentCamera not Camera, as a new Camera instance is made every time somebody respawns. However, you're only allowed to use CurrentCamera with a LocalScript

Ad
Log in to vote
-1
Answered by
P100D 590 Moderation Voter
9 years ago

I think the problem here is that you're using PlayerAdded, which is triggered when a player enters the server. I don't remember how to check if a character dies.

0
if you figure out what it is please tell me! Thank you!!! yogipanda123 120 — 9y

Answer this question