Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --UperTorsoScript
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health - 1
- end
- end
- script.Parent.Touched:connect(onTouched)
- --LowerTorsoScript
- local jumpscareModule = require(game.ReplicatedStorage:WaitForChild("Modules"):WaitForChild("Jumpscare Manager"))
- local debounces = { }
- local Players = game:GetService("Players")
- script.Parent.Touched:connect(function(hit)
- local player = game.Players:GetPlayerFromCharacter(hit.Parent)
- if debounces[player] then
- return -- If their debounce is still active then return
- end
- debounces[player] = true
- jumpscareModule.Jumpscare(player)
- wait(4)
- debounces[player] = nil
- end)
- --RagdollR15Script
- local character = script.Parent
- function recurse(root,callback,i)
- i= i or 0
- for _,v in pairs(root:GetChildren()) do
- i = i + 1
- callback(i,v)
- if #v:GetChildren() > 0 then
- i = recurse(v,callback,i)
- end
- end
- return i
- end
- function ragdollJoint(part0, part1, attachmentName, className, properties)
- attachmentName = attachmentName.."RigAttachment"
- local constraint = Instance.new(className.."Constraint")
- constraint.Attachment0 = part0:FindFirstChild(attachmentName)
- constraint.Attachment1 = part1:FindFirstChild(attachmentName)
- constraint.Name = "RagdollConstraint"..part1.Name
- for _,propertyData in next,properties or {} do
- constraint[propertyData[1]] = propertyData[2]
- end
- constraint.Parent = character
- end
- function getAttachment0(attachmentName)
- for _,child in next,character:GetChildren() do
- local attachment = child:FindFirstChild(attachmentName)
- if attachment then
- return attachment
- end
- end
- end
- character:WaitForChild("Humanoid").Died:connect(function()
- local camera = workspace.CurrentCamera
- if camera.CameraSubject == character.Humanoid then--If developer isn't controlling camera
- camera.CameraSubject = character.UpperTorso
- end
- --Make it so ragdoll can't collide with invisible HRP, but don't let HRP fall through map and be destroyed in process
- character.HumanoidRootPart.Anchored = true
- character.HumanoidRootPart.CanCollide = false
- --Helps to fix constraint spasms
- recurse(character, function(_,v)
- if v:IsA("Attachment") then
- v.Axis = Vector3.new(0, 1, 0)
- v.SecondaryAxis = Vector3.new(0, 0, 1)
- v.Rotation = Vector3.new(0, 0, 0)
- end
- end)
- --Re-attach hats
- for _,child in next,character:GetChildren() do
- if child:IsA("Accoutrement") then
- --Loop through all parts instead of only checking for one to be forwards-compatible in the event
- --ROBLOX implements multi-part accessories
- for _,part in next,child:GetChildren() do
- if part:IsA("BasePart") then
- local attachment1 = part:FindFirstChildOfClass("Attachment")
- local attachment0 = getAttachment0(attachment1.Name)
- if attachment0 and attachment1 then
- --Shouldn't use constraints for this, but have to because of a ROBLOX idiosyncrasy where
- --joints connecting a character are perpetually deleted while the character is dead
- local constraint = Instance.new("HingeConstraint")
- constraint.Attachment0 = attachment0
- constraint.Attachment1 = attachment1
- constraint.LimitsEnabled = true
- constraint.UpperAngle = 0 --Simulate weld by making it difficult for constraint to move
- constraint.LowerAngle = 0
- constraint.Parent = character
- end
- end
- end
- end
- end
- ragdollJoint(character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", {
- {"LimitsEnabled",true};
- {"UpperAngle",5};
- })
- ragdollJoint(character.UpperTorso, character.Head, "Neck", "BallSocket", {
- {"LimitsEnabled",true};
- {"UpperAngle",15};
- })
- local handProperties = {
- {"LimitsEnabled", true};
- {"UpperAngle",0};
- {"LowerAngle",0};
- }
- ragdollJoint(character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties)
- ragdollJoint(character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties)
- local shinProperties = {
- {"LimitsEnabled", true};
- {"UpperAngle", 0};
- {"LowerAngle", -75};
- }
- ragdollJoint(character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties)
- ragdollJoint(character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties)
- local footProperties = {
- {"LimitsEnabled", true};
- {"UpperAngle", 15};
- {"LowerAngle", -45};
- }
- ragdollJoint(character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties)
- ragdollJoint(character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties)
- --TODO fix ability for socket to turn backwards whenn ConeConstraints are shipped
- ragdollJoint(character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket")
- ragdollJoint(character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket")
- ragdollJoint(character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket")
- ragdollJoint(character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket")
- ragdollJoint(character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket")
- ragdollJoint(character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket")
- end)
- --RespawnScript
- name="Humanoid"
- robo=script.Parent:clone()
- while true do
- wait(5)
- if script.Parent.Humanoid.Health<1 then
- robot=robo:clone()
- robot.Parent=script.Parent.Parent
- robot:makeJoints()
- script.Parent:remove()
- end
- end
- --AiScript
- --Beta SpeedAI June 2012 -- Still has logic bugs - Look for updates..
- -- Kill added.
- -- co-operate/other "AI"s
- -- Climb "Truss" Parts
- -- Offset Ray
- -- Swim - Does not work. Don't know why.
- -- Adjusted Jump Ray
- -- Ray Graphics On/Off - flip line 90
- -- Delay next cycle, if Falling.
- -- Diagonal movement - I should add right-hand logic as well...
- local number = 1 + math.random()
- local BRAINWave = .6 -- AND line 38: Wait() between cycles of main loop
- local hum = nil -- Will be a pointer to the Humanoid of our AI.
- wait(number) -- hold on a sec. and spread multiple instances.
- --Globals
- local AI = script.Parent
- local AIName = AI.Name
- local AItorso = AI.UpperTorso
- if true then -- if your torso doesn't have a Humanoid; flip this to false
- local HumanoidType = nil -- find-a-HumanoidObject -- make sure
- local list = AI:GetChildren() -- temp var.
- for x = 1, #list do
- local temp = list[x]
- if (temp.className == "Humanoid") then
- HumanoidType = temp.Name
- end -- found Humanoid
- end -- AI Parts
- if HumanoidType then
- number = math.floor(number*100) -- serial# of AI
- hum = AI[HumanoidType]
- BRAINWave = 7/hum.WalkSpeed -- For extreme speeds, this may have to be adjusted.
- print (script, ": Humanoid = ", hum, AI:GetFullName(), number, "- Think Speed = ", BRAINWave)
- end
- end -- set speed
- --Constants;
- local RAYLength = 100 -- Not really. A point, off in space.
- --Declarations
- local target = AItorso -- is of type torso
- local torsoPos = AItorso.Position
- local targpos = target.Position
- --local Oldtargpos = targpos
- local OldPos = torsoPos * 2
- local origin = CFrame.new(torsoPos)
- local Logic = 0
- local OldX = 100
- local OldZ = 0
- local Xdir = 100
- local Zdir = 0
- local ClimbingLadder = false
- local FreeFalling = false
- local GraphicsOn = script.GraphicsToggle.Value -- Only set at start
- --functions
- -- Are we falling?
- hum.FreeFalling:connect(function()
- FreeFalling = true
- end)
- -- Find Player (& who else not to find).
- function findNearestTorso(pos) -- declare pos a local vector3
- local list = game.Workspace:children()
- local torso = nil
- local dist = 100000 -- Area to search
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if temp2.className == "Model" then
- temp = temp2:findFirstChild("UpperTorso")
- if temp ~= nil then
- human = temp2:findFirstChild("Humanoid")
- if human ~= nil and (human.Health > 0) and (temp2.Name ~= AIName) then -- not named the same as us.
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end -- closer?
- end -- human? Not us.
- end -- Has torso?
- end -- Model?
- end -- For. Loop thru parts in Workplace
- return torso
- end -- findNearest
- function DrawRay(origin, point) -- 7 studs long
- local Ray = Ray.new(origin, (point).unit * 7) --Make the ray.
- local Hit,Position = game.Workspace:FindPartOnRay(Ray,AI) --Check for collisions along the ray, ignoring any Parts of us.
- if GraphicsOn then --Graphics
- local RayPart = Instance.new("Part",AI)
- if Hit then
- if Logic == 1 then
- RayPart.BrickColor = BrickColor.new("Black") --Set its color.
- else
- RayPart.BrickColor = BrickColor.new("Bright red") --Set its color.
- end
- else
- if Logic == 1 then
- RayPart.BrickColor = BrickColor.new("White") --Set its color.
- else
- RayPart.BrickColor = BrickColor.new("Olive") --Set its color.
- end
- end
- RayPart.Transparency = 0.2 --Set its transparency.
- RayPart.Anchored = true --Set whether it will fall or not.
- RayPart.CanCollide = false --Set whether people can walk though it or not.
- RayPart.formFactor = Enum.FormFactor.Custom --Make it so it can be small.
- local Distance = (Position-origin).magnitude --Find the distance between the hit and the torso.
- RayPart.Size = Vector3.new(0.4,.2,Distance) --Set its size to the distance.
- RayPart.CFrame = CFrame.new(Position, origin) * CFrame.new(0,0,-Distance/2) --Move it halfway.
- game.Debris:AddItem(RayPart,2) --Add it to the debris.
- end -- Graphics
- return Hit
- end -- DrawRay
- function FireRayToward() -- possible path, and read the Part we hit, if any.
- ClimbingLadder = false
- local originPrime = origin * Vector3.new(.8,0,0) - Vector3.new(0,.4,0) -- Offset Right + OffY
- local offset = origin * Vector3.new(.8,0,0) - origin * Vector3.new(-.8,0,0) -- left (I guess this is increment. I didn't WANT to do it this way)
- local point = origin.lookVector * 7 -- dir
- local pointPrime = point - offset + Vector3.new(0,2,0) -- dir + OffsetLeft + OffsetY = direction of Ray
- local Hit = DrawRay(originPrime, pointPrime) -- see if we hit anything
- if Hit then
- if target.Parent == Hit.Parent then
- -- AI.Head:BreakJoints()
- if Hit.Name ~= "UpperTorso" and Hit.Name ~= "Head" then
- Hit:BreakJoints()
- Hit.CanCollide = true
- else
- Hit.Parent.Humanoid:TakeDamage(84)
- end -- kill
- Logic = 0
- Hit = nil
- elseif Hit.Parent.Name == AIName then
- -- if Xdir > 0 then -- if going ?North? then ignore, else (?South?); Jump
- -- Hit = nil -- ignore
- -- elseif Xdir == 0 then -- else swerve (only while in logic).
- if Xdir == 0 then
- Hit = Aitorso-- this should result in Hit = true-but-don't-attemp-a-jump, so swerve; doesn't check floor!
- -- return hit -- Swerve, without checking to jump.
- elseif Hit.Velocity.y > 1 then
- Hit = nil -- ignore, if other AI is already jumping; else check to Jump
- end -- East -West collisions - swerve. North/South, check-to-jump.
- end -- endifs
- end -- read hit
- -- Climb or Jump
- if Hit and Hit ~= AItorso then
- if (Hit.Name == "Truss" and target.Position.y > torsoPos.y - 3) or target.Parent == Hit.Parent then -- ignore parts called "Ladder", if AI is level or below CURRENT Targ pos.
- Hit = nil
- ClimbingLadder = true -- Climb and don't check floor
- else
- --print(Hit, Hit.Name)
- if Hit.Name == "Terrain" or Hit.CanCollide == false then -- In front is Water or a steep hill made of Terrain.
- Hit = nil -- swim or climb, or Ray hit a Non-colliding Part; and don't check for floor. This will not do, as we do not get a Hit when under-water, so we will check for floor. We must check Swimming event.
- else -- Jump?
- Hit = DrawRay(originPrime + Vector3.new(0,4.8,0), pointPrime)
- if Hit == nil then -- (Does NOT check CanCollide of Part blocking Jump)
- hum.Jump = true -- we do NOT check for "Floor", if jumping, but it might be a good idea.
- end -- Room to jump?
- end --Terrain? Water?
- end -- Ladder?
- else -- path is clear. Check for cliff... or OK to drop
- local Level = torsoPos.y
- if target then
- Level = target.Position.y -- get Target's current position.
- else -- Target is dead. Abandon all logic...
- Logic = 0 -- but still check for floor
- end
- if torsoPos.y - 2 < Level then -- if Player is not well below us...
- Hit = DrawRay(torsoPos + point * .8 + Vector3.new(0,1,0), Vector3.new(0,-7,0)) -- check for floor 85% of dir ahead
- if Hit == nil then -- There is no floor
- Hit = true -- Force a hit; we may not be able to get back up here.
- else
- Hit = nil -- Force a false to hit, 'cause everything is OK. (Does NOT check CanCollide of Floor!)
- end -- cliff check
- end -- Player Hieght
- end -- path ok?
- return Hit
- end -- FireRayToward
- function FireAtPlayer()
- origin = CFrame.new(torsoPos, Vector3.new(targpos.x, torsoPos.y, targpos.z)) -- This contains Origin & Direction
- local hit = FireRayToward()
- return hit
- end
- function FireRayAhead()
- origin = CFrame.new(torsoPos, torsoPos + Vector3.new(Xdir, 0, Zdir))
- local hit = FireRayToward()
- targpos = torsoPos + Vector3.new(Xdir,0,Zdir)
- return hit
- end
- function FireRay() -- Fire Ahead and diagonaly
- origin = CFrame.new(torsoPos, torsoPos + Vector3.new(Xdag, 0, Zdag))
- local hit = FireRayToward()
- if hit then
- origin = CFrame.new(torsoPos, torsoPos + Vector3.new(Xdir, 0, Zdir))
- hit = FireRayToward()
- if not hit then
- targpos = torsoPos + Vector3.new(Xdir,0,Zdir)
- end
- else
- targpos = torsoPos + Vector3.new(Xdag,0,Zdag)
- end
- return hit
- end -- Fire Ray
- function FireDag()
- origin = CFrame.new(torsoPos, torsoPos + Vector3.new(Xdag, 0, Zdag))
- local hit = FireRayToward()
- return hit
- end -- Fire Diagonaly
- function TurnRight()
- if Xdir == 0 then
- Xdir = -Zdir
- Zdir = 0
- else
- Zdir = Xdir
- Xdir = 0
- end
- if Xdag == Zdag then Xdag = -Xdag else Zdag = -Zdag end
- end -- Left
- function TurnLeft()
- if Xdir == 0 then
- Xdir = Zdir
- Zdir = 0
- else
- Zdir = -Xdir
- Xdir = 0
- end
- if Xdag == Zdag then Zdag = -Zdag else Xdag = -Xdag end
- end -- Left
- function GetDir()
- Xdir = (targpos.x - torsoPos.x) -- Which way are we going?
- Zdir = (targpos.z - torsoPos.z)
- -- if Zdir < 0 then -- Get closest 45 degree angle. Diagonal.
- -- Zdag = -RAYLength
- -- else
- -- Zdag = RAYLength
- -- end
- -- if Xdir < 0 then
- -- Xdag = -RAYLength
- -- else
- -- Xdag = RAYLength
- -- end
- if math.abs(Xdir) > math.abs(Zdir) then -- Ordinal.
- if Xdir < 0 then
- Xdir = -RAYLength
- -- convert to our direction indicator.
- else
- Xdir = RAYLength
- end
- Zdag = Xdir -- Diagonal Right.
- Xdag = Xdir
- Zdir = 0
- else -- abs
- if Zdir < 0 then
- Zdir = -RAYLength
- else
- Zdir = RAYLength
- end
- Zdag = Zdir
- Xdag = -Zdir
- Xdir = 0
- end -- abs
- end -- GetDir
- while AItorso do -- while I still have a body; search.
- torsoPos = AItorso.Position
- local targ = workspace.Terrain -- Temp targ
- local Distance =(torsoPos - OldPos).magnitude -- Distance traveled, since last loop
- --local Distance =10
- if target == nil then Logic = 0
- -- Distance = 10
- end -- Player died.
- if Logic == 0 then -- Defalt logic
- target = findNearestTorso(torsoPos) --- target is some Player. FindNearest and get xdir, ydir.
- if target ~= nil then
- targ = target
- -- if ClimbingLadder and Distance >= 1 then
- -- targpos = torsoPos + AItorso.CFrame.lookVector * 9
- -- else
- targpos = target.Position
- -- end
- if Distance < 1 and (torsoPos - targpos).magnitude > 4 then -- Check if we are stuck.
- GetDir()
- OldX = Xdir -- Goal direction.
- OldZ = Zdir
- Logic = 1 -- Impeded
- else
- if FireAtPlayer() then -- hit
- GetDir()
- OldX = Xdir -- Goal direction.
- OldZ = Zdir
- if FireDag() then
- Logic = 1 -- Go Left; Look Right.
- ClimbingLadder = true -- first time thru logic 1 indicator
- else
- targpos = torsoPos + Vector3.new(Xdag,0,Zdag) -- go Right
- end -- dagRight
- end -- hit?
- end -- impeded?
- else
- print(AIName, number, ": No target. - ", target)
- -- torsoPos = torsoPos * 2 -- Turn Impeded?, off
- -- Distance = 10
- end -- if no target?
- end -- Logic 0
- -- 1 - Look Right or Go left
- if Logic == 1 then
- if Distance >= 1 then
- if ClimbingLadder == false then -- or target.Position.y < torsoPos.y + 4 then
- TurnRight()
- end -- else go straight or go up
- else
- TurnLeft()
- end
- if FireRayAhead() then -- Check straight first. (And Diagonaly left)
- TurnLeft()
- if FireRay() then -- Check left (And Diagonaly left & back)
- TurnLeft()
- if FireRay() then
- TurnLeft()
- if FireRay() then
- targpos = torsoPos + Vector3.new(Xdir,0,Zdir)
- hum.Jump = true
- end -- right
- end -- Back
- end -- Left
- else -- If succesful Ahead then... (We only check RightTurns for a get-out-of-jail-Free card)
- if Xdir == OldX and OldZ == Zdir then -- Gracefully exiting Logic 1
- Logic = 0
- end -- check Goal dir?
- end -- Ahead
- end -- Logic 1
- -- go
- OldPos = torsoPos
- hum:MoveTo(targpos, targ) -- MoveToward Target
- --wait
- wait(BRAINWave)
- while FreeFalling do
- FreeFalling = false
- wait(.2)
- end
- end -- Main
- --WeaponFiringScript
- local target = script.Parent:WaitForChild("Target")
- local torso = script.Parent.Parent:WaitForChild("Torso")
- local down = script.Parent:WaitForChild("MouseDown")
- function handler(new)
- if target.Value then
- while target.Value == new do
- if target.Value and target.Value.Parent == nil then
- target.Value = nil
- return
- end
- local look = (new.Torso.Position-torso.Position).unit * 300
- local hit = workspace:FindPartOnRayWithIgnoreList(Ray.new(torso.Position,look),{script.Parent.Parent,new.Parent})
- if not hit or (new.Torso.Position-torso.Position).magnitude < 10 then
- down:Fire(new.Torso.Position)
- end
- wait(0.2)
- end
- end
- end
- target.Changed:connect(handler)
- if target.Value then
- handler(target.Value)
- end
- --PathFindongScript
- debugMode = false
- targetNPCs = false
- --
- h = script.Parent.Parent:WaitForChild("Humanoid")
- pathService = game:GetService("PathfindingService")
- targetV = script.Parent:WaitForChild("Target")
- function closestTargetAndPath()
- local humanoids = {}
- if targetNPCs then
- local function recurse(o)
- for _,obj in pairs(o:GetChildren()) do
- if obj:IsA("Model") then
- if obj:findFirstChild("Humanoid") and obj:findFirstChild("Torso") and obj.Humanoid ~= h and obj.Humanoid.Health > 0 and not obj:findFirstChild("ForceField") then
- table.insert(humanoids,obj.Humanoid)
- end
- end
- recurse(obj)
- end
- end
- recurse(workspace)
- else
- for _,v in pairs(game.Players:GetPlayers()) do
- if v.Character and v.Character:findFirstChild("HumanoidRootPart") and v.Character:findFirstChild("Humanoid") and v.Character.Humanoid.Health > 0 and not v:findFirstChild("ForceField") then
- table.insert(humanoids,v.Character.Humanoid)
- end
- end
- end
- local closest,path,dist
- for _,humanoid in pairs(humanoids) do
- local myPath = pathService:ComputeRawPathAsync(h.Torso.Position,humanoid.Torso.Position,500)
- if myPath.Status ~= Enum.PathStatus.FailFinishNotEmpty then
- -- Now that we have a successful path, we need to figure out how far we need to actually travel to reach this point.
- local myDist = 0
- local previous = h.Torso.Position
- for _,point in pairs(myPath:GetPointCoordinates()) do
- myDist = myDist + (point-previous).magnitude
- previous = point
- end
- if not dist or myDist < dist then -- if true, this is the closest path so far.
- closest = humanoid
- path = myPath
- dist = myDist
- end
- end
- end
- return closest,path
- end
- function goToPos(loc)
- h:MoveTo(loc)
- local distance = (loc-h.Torso.Position).magnitude
- local start = tick()
- while distance > 4 do
- if tick()-start > distance/h.WalkSpeed then -- Something may have gone wrong. Just break.
- break
- end
- distance = (loc-h.Torso.Position).magnitude
- wait()
- end
- end
- while wait() do
- local target,path = closestTargetAndPath()
- local didBreak = false
- local targetStart
- if target and h.Torso then
- targetV.Value = target
- targetStart = target.Torso.Position
- roaming = false
- local previous = h.Torso.Position
- local points = path:GetPointCoordinates()
- local s = #points > 1 and 2 or 1
- for i = s,#points do
- local point = points[i]
- if didBreak then
- break
- end
- if target and target.Torso and target.Health > 0 then
- if (target.Torso.Position-targetStart).magnitude < 1.5 then
- local pos = previous:lerp(point,.5)
- local moveDir = ((pos - h.Torso.Position).unit * 2)
- goToPos(previous:lerp(point,.5))
- previous = point
- end
- else
- didBreak = true
- break
- end
- end
- else
- targetV.Value = nil
- end
- if not didBreak and targetStart then
- goToPos(targetStart)
- end
- end
- --JumpscareLocaly
- local jumpscareModule = require(game.ReplicatedStorage:WaitForChild("Modules"):WaitForChild("Jumpscare Manager"))
- local jumpscareRemote = game.ReplicatedStorage:WaitForChild("Modules"):WaitForChild("Jumpscare Manager"):WaitForChild("Activate Jumpscare")
- jumpscareRemote.OnServerEvent:Connect(function(player)
- jumpscareModule.Jumpscare(player)
- end)
- --JumpscareManagerScript
- local module = {
- Animation = script.Animation;
- Duration = 0.6;
- Camera = workspace.Cameras.JumpscareCamera;
- DieAfter = true
- }
- function module.Jumpscare(player)
- local camRemote = player.PlayerGui.ChangeCamera
- camRemote:FireClient(player,module.Camera)
- local JumpscareDummy = workspace.JumpscareDummy
- local dummyHum = JumpscareDummy.Humanoid
- local scare = JumpscareDummy.Head.scarysound
- dummyHum:LoadAnimation(module.Animation):Play()
- scare:Play()
- wait(module.Duration)
- if module.DieAfter then
- player.Character:BreakJoints()
- end
- end
- return module
- --CameraScript
- local camera = workspace.CurrentCamera
- local player = game.Players.LocalPlayer
- local character = player.Character or player:CharacterAdded()
- script.Parent.OnClientEvent:Connect(function(camera2,duration)
- camera.CameraType = "Scriptable"
- camera.CFrame = camera2.CFrame
- end)
- character:WaitForChild("Humanoid").Died:Connect(function()
- wait(1)
- camera.CameraSubject = character:WaitForChild("Humanoid")
- camera.CameraType = "Custom"
- camera.CFrame = character.Head.CFrame
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement