I wrote this script a couple weeks ago, and it was working fine. Datastore working fine.
Now today, it returns HTTP 500 (Internal Server Error) like 4 times, and I do not know what to do.
https://gyazo.com/6d3ac6ec15e2812b462ef48b664c25ce
Here is my script:
PlayerInitHandler.lua (located in ServerScriptService)
-- made by recanman
game.Players.PlayerAdded:Connect(function(plr)
local ds2 = require(1936396537) -- ds2 module, downloading it here so I don't slow it down
repeat wait() until (plr.Character ~= nil)
ds2.Combine("DATA", "Coins", "WritingDevices", "Ink", "RedeemedCodes")
local coinsDs = ds2("Coins", plr)
local wdDs = ds2("WritingDevices", plr)
local inkDs = ds2("Ink", plr)
local ls = Instance.new("StringValue", plr)
ls.Name = "leaderstats"
local coins = Instance.new("IntValue", ls)
coins.Name = "Coins"
coins.Value = coinsDs:Get(0)
local iv = Instance.new("Folder", plr.Character)
iv.Name = "InkValues"
local ink = Instance.new("IntValue", iv)
ink.Name = "Ink"
local maxInk = Instance.new("IntValue", iv)
maxInk.Name = "MaxInk"
local currentWd = Instance.new("StringValue", plr)
currentWd.Name = "CurrentWritingDevice"
local currentInk = Instance.new("StringValue", plr)
currentWd.Name = "CurrentInk"
for _, child in ipairs(game.ReplicatedStorage.Assets.WritingDevices:GetChildren()) do
if (child:IsA("Tool")) then
local settings = require(child.Settings)
if (settings.Order == wdDs:Get(1)) then
print("Found WritingDevice for " .. plr.Name .. ", named " .. child.Name .. ", tier " .. settings.Order)
child:Clone().Parent = plr.Backpack
currentWd.Value = child.Name
end
end
end
for _, child in ipairs(game.ReplicatedStorage.Assets.Ink:GetChildren()) do
if (child:IsA("BasePart")) then
local settings = require(child.Settings)
if (settings.Order == inkDs:Get(1)) then
print("Found Ink for " .. plr.Name .. ", named " .. child.Name .. ", tier " .. settings.Order)
ink.Value = settings.Ink
maxInk.Value = ink.Value
currentInk.Value = child.Name
end
end
end
coins.Changed:Connect(function()
coinsDs:Set(coins.Value)
end)
end)