game.Players.PlayerAdded:Connect(function(plr)
local P = Instance.new("BoolValue", plr) or 0
P.Name = "isShiftlock"
end)
This is a script in Serverscriptservice, that creates a BoolValue when a player joins. I want it so that everytime a player dies, the boolvalue is set to false.
game.Players.PlayerAdded:Connect(function(plr)
local P = Instance.new("BoolValue", plr)
P.Name = "isShiftlock"
local function onPlayerDied()
P.Value = false
end
plr.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Connect(onPlayerDied)
end)
end)
I have tried that but it does not work.