Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script doesn't work after player dies?

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
)

2 comments

0

Is the script in StarterPlayerScripts or StarterCharacterScripts?

0

StarterPlayerScripts

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.