|
Post by sukadia on Aug 7, 2017 7:41:03 GMT
Hello! I'm trying to make it so once the player leaves the game, they cannot join it again.
EDIT: I've created this script along with a value that increases everytime the player joins.
game.Players.PlayerAdded:connect(function(plr)
wait(5)
local banned = plr.Stats.Level.Value
if banned == 1 then
plr:Kick("You've already seen too much.")
if banned >= 2 then
plr:Kick("Stop trying.")
end
end
end)
I've checked ingame that the Level.Value does save and increase everytime you join, but it won't kick me once its 2 or over. Mind figuring out what's the problem? No errors pop up in the script analysis.
|
|
lae
Active Member
Veteran
Posts: 27
ROBLOX Username: LaeMVP
|
Post by lae on Aug 8, 2017 15:35:06 GMT
local DS = game:GetService("DataStoreService"):GetDataStore("Bans") game:GetService("Players").PlayerAdded:Connect(function(plr) if DS:GetAsync(plr.UserId) then plr:Kick("You're banned") end end) game:GetService("Players").PlayerRemoving:Connect(function(plr) if not DS:GetAsync(plr.UserId) then DS:SetAsync(plr.UserId,true) end end)
Something like that?
|
|
|
Post by sukadia on Aug 19, 2017 1:32:03 GMT
Edit bump
|
|