I want to make a camera part which will be the main camera from when you spawn, until when you change place. Take in mind that this script is into a local script, which is inserted into workspace, not into the part which the camera is.
repeat wait() until game:GetService("Players").LocalPlayer.Character ~= nil local Player = game:GetService("Players").LocalPlayer local Character = Player.Character local Torso = Character.Torso local Humanoid = Character:WaitForChild("Humanoid") local Camera = workspace.CurrentCamera local Part = script.Parent.CameraPart local NotMoving = true -- nothing to do with the camera, it just stuns the player while the camera is working while NotMoving == true do wait() Humanoid.WalkSpeed = 0 Humanoid.Changed:connect(function() Humanoid.Jump = false end) Camera.CameraType = "Scriptable" Camera.CoordinateFrame = workspace.CameraPart.CFrame -- nothing to do with the camera, it just stuns the player while the camera is working end
Uhh, hey. Not sure if this is what you want, but try this.
repeat wait() until game:GetService("Players").LocalPlayer.Character ~= nil local Player = game:GetService("Players").LocalPlayer local Character = Player.Character local Torso = Character.Torso local Humanoid = Character:WaitForChild("Humanoid") local Camera = game.Workspace.CurrentCamera local Part = script.Parent.Parent.CameraPart local NotMoving = true -- nothing to do with the camera, it just stuns the player while the camera is working while NotMoving == true do wait() Humanoid.WalkSpeed = 0 Humanoid.Changed:connect(function() Humanoid.Jump = false end) Camera.CameraType = "Scriptable" Camera.CoordinateFrame = workspace.CameraPart.CFrame -- nothing to do with the camera, it just stuns the player while the camera is working end