My boolvalue can’t save anything, Boolvalue’s value saves itself, but not everything else.
Character inside the frame should be black, as default, when value sets to true, it will be visible. Works sometimes, not all the time.
Server script (Data Store):
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CashData = DataStore:GetDataStore("CashStats") --Cash Data
local BoughtMorphs = DataStore:GetDataStore("BoughtMorphs")
local Value = 0
local Quests = game.ReplicatedStorage.Quests
local LizzyEarlyAccess = Quests.LizzyEarlyAccess
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = ("leaderstats")
leaderstats.Parent = player
-----------------------------------------------------------
local Tokens = Instance.new("IntValue")
Tokens.Name = ("Tokens") --Cash Value
Tokens.Parent = leaderstats
Tokens.Value = 0 -- Starter Value
Tokens.Value = CashData:GetAsync(player.UserId) or Value
LizzyEarlyAccess.Value = BoughtMorphs:GetAsync(player.UserId)
CashData:SetAsync(player.UserId, Tokens.Value)
BoughtMorphs:SetAsync(player.UserId, LizzyEarlyAccess.Value)
------------------------------------------------------------
game.Players.PlayerRemoving:Connect(function(player)
CashData:SetAsync(player.UserId, Tokens.Value)
BoughtMorphs:SetAsync(player.UserId, LizzyEarlyAccess.Value)
end)
end)
game.ReplicatedStorage.Remotes.Bought_.OnServerEvent:Connect(function(player)
local morphframe = player.PlayerGui.MorphGui.MainFrameMenu.MorphsMenu
if player.leaderstats.Tokens.Value > 29 and LizzyEarlyAccess.Value == false then
player.leaderstats.Tokens.Value -= 30
LizzyEarlyAccess.Value = true
--[[LizzyEarlyAccess:GetPropertyChangedSignal("Value"):Connect(function()
if LizzyEarlyAccess.Value == false then
morphframe.Viewports.LizEarlyAccess.Buy.Visible = true
morphframe.Viewports.LizEarlyAccess.LizzyEarlyAccess.Visible = false
morphframe.Viewports.LizEarlyAccess.Ambient = Color3.fromRGB(0, 0, 0)
morphframe.Viewports.LizEarlyAccess.LightColor = Color3.fromRGB(0, 0, 0)
morphframe.Viewports.LizEarlyAccess.WorldModel.LizzyEarlyAccess.All_Accessories.Head_Accessories.LeftPupil.Transparency = 1
morphframe.Viewports.LizEarlyAccess.WorldModel.LizzyEarlyAccess.All_Accessories.Head_Accessories.RightPupil.Transparency = 1
elseif LizzyEarlyAccess.Value == true then
morphframe.Viewports.LizEarlyAccess.Buy.Visible = false
morphframe.Viewports.LizEarlyAccess.LizzyEarlyAccess.Visible = true
morphframe.Viewports.LizEarlyAccess.Ambient = Color3.fromRGB(200, 200, 200)
morphframe.Viewports.LizEarlyAccess.LightColor = Color3.fromRGB(140, 140, 140)
morphframe.Viewports.LizEarlyAccess.WorldModel.LizzyEarlyAccess.All_Accessories.Head_Accessories.LeftPupil.Transparency = 0
morphframe.Viewports.LizEarlyAccess.WorldModel.LizzyEarlyAccess.All_Accessories.Head_Accessories.RightPupil.Transparency = 0
end
end)]]
end
end)
Local script (inside a button so player can buy a chracter.
local player = game.Players.LocalPlayer
local button_ = script.Parent
local rep_storage = game:GetService("ReplicatedStorage")
local morph_ = rep_storage.Remotes.Morph_Plr_
local name_ = button_.Name
local morph_frame = button_.Parent.WorldModel.LizzyEarlyAccess
local sounds_ = rep_storage.Music_
local Quests = game.ReplicatedStorage.Quests
local LizzyEarlyAccess = Quests.LizzyEarlyAccess
local cooldown_ = false
button_.MouseButton1Click:Connect(function()
sounds_.Click:Play()
if cooldown_ == false then
cooldown_ = true
if player.leaderstats.Tokens.Value > 29 and LizzyEarlyAccess.Value == false then
sounds_.Tokens_SFX:Play()
rep_storage.Remotes.Bought_:FireServer(player)
end
wait(2)
cooldown_ = false
end
end)
LizzyEarlyAccess:GetPropertyChangedSignal("Value"):Connect(function()
if LizzyEarlyAccess.Value == true then
button_.Visible = false
button_.Parent.LizzyEarlyAccess.Visible = true
button_.Parent.Ambient = Color3.fromRGB(200, 200, 200)
button_.Parent.LightColor = Color3.fromRGB(140, 140, 140)
morph_frame.All_Accessories.Head_Accessories.LeftPupil.Transparency = 0
morph_frame.All_Accessories.Head_Accessories.RightPupil.Transparency = 0
elseif LizzyEarlyAccess.Value == false then
button_.Visible = true
button_.Parent.LizzyEarlyAccess.Visible = false
button_.Parent.Ambient = Color3.fromRGB(0, 0, 0)
button_.Parent.LightColor = Color3.fromRGB(0, 0, 0)
morph_frame.All_Accessories.Head_Accessories.LeftPupil.Transparency = 1
morph_frame.All_Accessories.Head_Accessories.RightPupil.Transparency = 1
end
end)
--[[while LizzyEarlyAccess.Value == true do
wait(6)
button_.Visible = false
button_.Parent.LizzyEarlyAccess.Visible = true
button_.Parent.Ambient = Color3.fromRGB(200, 200, 200)
button_.Parent.LightColor = Color3.fromRGB(140, 140, 140)
morph_frame.All_Accessories.Head_Accessories.LeftPupil.Transparency = 0
morph_frame.All_Accessories.Head_Accessories.RightPupil.Transparency = 0
end]]
This was going on for a while now, please help!