I have tried this so far. Basically, the camera will be connected to a part and it will stun the player while it is connected. Tell me what I have wrong, it will be appreciated.
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 NotMoving = true while NotMoving == true do wait() Humanoid.WalkSpeed = 0 Humanoid.Changed:connect(function() Humanoid.Jump = false end) Camera.CameraType = "Scriptable" Camera.CoordinateFrame = workspace.CameraPart.CFrame -- CameraPart is the part which the camera will be connected to. end
You need to set the camera subject as well, and the camera subject can be any part, so just do "Camera.CameraSubject = workspace.Camera" and it should work
Also, CoordinateFrame is deprecated and you should replace it with Camera.CFrame instead which is the recommended one to use.
Try changing
Camera.CoordinateFrame
to
Camera.CFrame
also use :Connect instead of :connect for it is deprecated
Note: this script has to be a local script and in a place where it can run on the player (PlayerGui, Backpack)