I don't get why this is happening. There's a local script parented to a server script, then parented to a vehicleseat. I'm trying to make an RC car. The first time the camera works good, but then the second time you use it, it just does not want to focus on the car. Why is this happening!? Serverscript:
print("Camera script loading")
local newscript = script.CameraChange:Clone()
script.Parent.ChildAdded:Connect(function(weld)
if weld.Name == "SeatWeld" then
local h = script.Parent.Occupant
wait()
if h.Sit == true then
newscript.Parent = h.Parent
end
end
end)
localscript:
Camera = game.Workspace.CurrentCamera
Object = game.Workspace.HPIBlitz.HPIBlitz.Shell
Player = script.Parent.Humanoid
Camera.CameraSubject = Object
Camera.CameraType=3
while wait() do
if Player.Sit == false then
Camera.CameraSubject = Player
script:Destroy()
end
end

5 comments
The clone gets sent to the player. The original copy of the script is uneffected.
The clone gets sent to the player. The original copy of the script is uneffected.
The clone gets sent to the player. The original copy of the script is uneffected.
In your server script you're clong the localscript one time, and then you parent it to the seat occupant. In the localscript, you're making sure that the player is sitting and if it's not, then you destroy the localscript itself. So again, in the server script, when someone sits you parent the localscript, but it's nil because it doesn't exists anymore.
nvm it works