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

Camera Interpolation Is Killing Player?

Asked by
Donut792 216 Moderation Voter
4 years ago

so like the title says i have a camera interpolation script that works fine but once it finishes it just repeatedly kills the player over and over

Script:

local list = {38270341, 131541716, 41163273, 132007993, 552452701, -1}

game.Players.PlayerAdded:Connect(function(player)
        player.CharacterAdded:Connect(function(char)
        for i = 1, #list do
              if player.UserId == list[i] then
                local gui = script.TrueDarkness:Clone()
                gui.Parent = player.PlayerGui
                warn("Gave "..player.Name.." True Darkness!")
            end
        end
    end)
end)

--Misfortune comes uninvited.' It hungers for blood, craving eternal darkness. The time to repent is over! I will take up arms again, step out of the shadows, and teach them true darkness!
local debounce = false
game.ReplicatedStorage.TeachThemTrueDarkness.OnServerEvent:Connect(function(phar)
    if debounce == false then
        debounce = true
    for r = 1, #list do
        if phar.UserId == list[r] then
            local players = game.Players:GetChildren()
            for v = 1, #players do 
                print(players[v].Name)
                r = players[v].Character
            end
            local characters = r
            local humanoidroots = characters:FindFirstChild("HumanoidRootPart")
            local focus = phar.Character:FindFirstChild("HumanoidRootPart")
            local particles = script.Particles.Three
            local cloneicles = particles:Clone()
            local f = game.Lighting
            local Caster = script.LocalScript.Caster
            Caster.Value = phar.Name
                repeat
                    wait(.1)
                    f.ClockTime = f.ClockTime + .1
                until f.ClockTime == 23
                print("dark")
                game.ReplicatedStorage.TeachThemTrueDarkness:FireAllClients(focus)
            humanoidroots.Anchored = true
            cloneicles.Parent = focus
            local CloneScript = script.LocalScript:Clone()
                CloneScript.Parent = r
                CloneScript.Disabled = false
            workspace.Sounds.scary:Play()
            wait(5)
            cloneicles:Destroy()
            humanoidroots.Anchored = false
            debounce = false
                repeat
                    wait(.1)
                    f.ClockTime = f.ClockTime - 1
                until f.ClockTime == 16
                print("light")
            break
        else
            if debounce == false then
                debounce = true
                phar:Kick("EveryBody Actin' Suspicious")
                warn("Kicked "..phar.Name.." For Firing Darkness Event")
                debounce = false
                end
            end
        end
    end
end)

LocalScript:

local Caster = script:WaitForChild("Caster")
local CastValue = Caster.Value
local camera = game.Workspace.CurrentCamera
local Character = game.Workspace:FindFirstChild(CastValue)
local plr = game.Players.LocalPlayer
camera.CameraType = Enum.CameraType.Scriptable
camera:Interpolate(Character.Head.CFrame, Character.Head.CFrame, 2)
wait(1)
wait(2)
camera:Interpolate(plr.Character.Head.CFrame, plr.Character.Head.CFrame, 1)
wait(1)
camera.CameraType = Enum.CameraType.Custom

1 answer

Log in to vote
1
Answered by
mist0s 38
4 years ago

Hello, I had the same problem, and the problem is that you can't put the same things in the interpolate (you put 2 times Head). For resolving, you have to change one of the parameter.

0
alright thank you Donut792 216 — 4y
Ad

Answer this question