I'm making a shop and one of the items is a speed boost that lasts for one life. Once you click to spawn in, the script checks if the "speedpower" boolValue is true or false. If it is true, it gives you high speed and changes the value to false. The shop will not let you buy the speedpower if you already have it. However, if you die and no longer have the boolValue set to true, the script will still not let you buy it and reads that the value is True, even though it is false. Here is the Script
game.ReplicatedStorage.RemoteEvents.SpeedUpEvent.OnServerEvent:Connect(function(player)
local money = player.leaderstats.Money
local speedpower = player.powerstats.speedpower
if money.Value >= 5 then
print("Not Broke")
if speedpower.Value == false then
money.Value = money.Value - 5
speedpower.Value = true
else
print("Already Active")
end
else
print("Broke")
end
end)
This is the other function, which fires when a menu button is clicked. It is in a local script, would this be the problem?
if powerstats:WaitForChild("speedpower").Value == true then
player.Character.Humanoid.WalkSpeed = 30
powerstats:WaitForChild("speedpower").Value = false
else
player.Character.Humanoid.WalkSpeed = 16
end

3 comments
Can you post all the scripts involving this speed powerup?
Maybe the value is set to false localy, and the server still thinks its true
btw, I just set it to trigger a remoteEvent into a server script, and it still does the same thing. In players, it says the value is false, but the buy function still thinks it's true.