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

Script doesn't work after player dies?

Asked by 5 years ago

I made this script to change some things in the player, it works fine but it doesn't work after the player dies. It might be caused by a spawn delay of 35 seconds. Script:

local blur =    Instance.new("BlurEffect", workspace.CurrentCamera)
blur.Name = "Water"
blur.Size = 0
local correct = Instance.new("ColorCorrectionEffect", workspace.CurrentCamera)
correct.Name = "WaterColor"
correct.TintColor = Color3.new()
wait(1)
local P = game.Players.LocalPlayer
P.Character.Humanoid.Running:Connect(
    function()
        P.Character.Humanoid.JumpPower = 40
        correct.TintColor = Color3.new(255/255, 255/255, 255/255)
        correct.Brightness = 0
        correct.Contrast = 0
        correct.Saturation = 0
        blur.Size = 0
    end
)
0
Is the script in StarterPlayerScripts or StarterCharacterScripts? GottaHaveAFunTime 218 — 5y
0
StarterPlayerScripts CaptainAlien132 225 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

If it's in Starterplayer, that's the cause. You should move it to StarterCharacter instead. When you have a script inside StarterPlayer, it runs only when you join. So once you die, the script will not run again, and the Running function will be disconnected. However, if it's in StarterCharacter, the script will run every time your character loads.

Ad

Answer this question