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

How to keep Same Value After Death?

Asked by 9 years ago

So one of my scripts changes a BoolValue from false to true to say if the player is that class or not.

The problem is after the player dies, the BoolValue Resets

Is there any way to make it not reset after death?

1 answer

Log in to vote
0
Answered by
Vrakos 109
9 years ago

Is the BoolValue in PlayerGui or Backpack? There's many ways to avoid this. Maybe by using a Configuration folder parented to the player, although it would involve a little bit of change in your code.

local Create = assert(LoadLibrary("RbxUtility")).Create

local Configuration = Create "Configuration" {
    Name = "Stats",
    Parent = game.Players.LocalPlayer
};

local Stat = Create "BoolValue" {
    Name = "Bool",
    Value = true,
    Parent = Configuration
}
0
The BoolValue is in Backpack, but it can be in either one. I used to spawn them in with a localscript, but that caused the values to clone after each death. Do you mind explaining how I can use your script and how it works? SpazzMan502 133 — 9y
0
Backpack resets when a player dies. Basically, my scripts creates a Configuration folder. What I used is another method for Instance.new, I just find it less hassle to use. All the properties are within a table. Vrakos 109 — 9y
Ad

Answer this question