so im trying to make a shop and i need an item to permanently set a value to unlock a power, how exactly would i do this? here's the item's code so far:
Tool = script.Parent
local replicatedstorage = game:GetService("ReplicatedStorage")
local useevent = replicatedstorage.BuyDistraction
local cd = false
Tool.Activated:Connect(function()
if cd == true then return end
cd = true
local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char.Humanoid
useevent:FireServer()
end)
and here's the useevent
game.ReplicatedStorage.BuyDistraction.OnServerEvent:Connect(function(player)
end)
it is empty right now, as i do not know what to put in it. any help would be appreciated!

1 comment
The only way to make stuff like that persistent through servers is to use data storing. Data storing saves information onto roblox's servers, and will then apply them to the player when entering the game again. It's a bit difficult to learn, but the dev forum explains a lot of it. https://developer.roblox.com/en-us/articles/Data-store