Hey developers. For some reason, the following script is not working. I put some test prints through it so you can see what works and what doesn’t. It appears to stop at the PlayerAdded function. All help is appreciated.
print("Script running") -- Printed
local commands = {}
commands.kill = function(target)
target.Character.Humanoid.Health = 0
end
commands.ban = function(userId)
end
commands.unban = function(userId)
end
print("Test1") -- Printed
local adminDs = game:GetService("DataStoreService"):GetDataStore("AdminDatastore")
print("Test2") -- Printed
require(4874365424) -- // Require the module for the icons
print("Test3") -- Printed
game.Players.PlayerAdded:Connect(function(plr)
print("Test4") -- Not printed
wait(3)
print(tostring(plr)) -- Not printed
local data = adminDs:GetAsync("User-=-" .. plr.UserId) or {"Guest", {(os.time() + 438765487365), 151814829, "Because you are a noob"}}
local rankdata = data[1]
local bandata = data[2]
if bandata[1] ~= 0 and bandata[1] >= os.time() then
print("Kick parameters met for " .. plr.Name)
plr:Kick("You have been banned from this game! \n \n You were banned by:" .. game:GetService("Players"):GetPlayerByUserId(bandata[2]) .. " \n \n Reason given: " .. bandata[3] .. " \n \n If you feel this ban was not fair or accurate, please join our server and appeal with our ticket system.")
end
end)
There are no errors btw.