You can write your topic however you want, but you need to answer these questions:
-
So I am making a WalkSpeeds Perks, and I used Datastore. But for some reason, when I started using BoolValue. It shows this up" [ServerScriptService.MainModule:566: DataStore2() API call expected {string dataStoreName, Instance player}, got {string, boolean}]"
-
Due to my lack of experience in datastore, I can’t quite find out the problem and a source of fixing it. I think it is mostly is because I wrote something wrong in this line " local WalkspeedData3 = DataStore2(“WS3”,player.leaderstats.WS3.Value)"
local DataStore2 = require(game.ServerScriptService:WaitForChild("MainModule"))
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("WalkSpeed1")
local remoteEvent2 = ReplicatedStorage:WaitForChild("WalkSpeed2")
local remoteEvent3 = ReplicatedStorage:WaitForChild("WalkSpeed3")
local function Perk1(player)
local leaderstats = player:FindFirstChild("leaderstats")
if leaderstats ~= nil then
local PerkPoints=DataStore2("PerkPoints",leaderstats.PerkPoints.Value)
local WalkspeedData3 = DataStore2("WS3",player.leaderstats.WS3.Value)
PerkPoints:Increment(-4)
WalkspeedData3:Increment(true)
end
end
remoteEvent3.OnServerEvent:Connect(Perk1)
local function Perk(player)
local leaderstats = player:FindFirstChild("leaderstats")
if leaderstats ~= nil then
local WalkspeedData1 = DataStore2("WS1",player.leaderstats.WS1.Value)
print(player.Name)
local PerkPoints=DataStore2("PerkPoints",leaderstats.PerkPoints.Value)
PerkPoints:Increment(-1)
WalkspeedData1:Increment(true)
end
end
remoteEvent.OnServerEvent:Connect(Perk)
local function Perk2(player)
local leaderstats = player:FindFirstChild("leaderstats")
if leaderstats ~= nil then
local PerkPoints=DataStore2("PerkPoints",leaderstats.PerkPoints.Value)
local WalkspeedData2 = DataStore2("WS2",player.leaderstats.WS2.Value)
WalkspeedData2:Increment(true)
PerkPoints:Increment(-2)
end
end
remoteEvent2.OnServerEvent:Connect(Perk2)
Can someone please give me a hint of fixing this?