Guest User

Code for question

a guest
Jun 18th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. local ds = game:GetService("DataStoreService"):GetGlobalDataStore("Test")
  2. local players = game:GetService("Players")
  3. local key = "key";
  4.  
  5. local function flip(c) return not c end
  6.  
  7. players.PlayerAdded:Connect(function(plr)
  8.     plr.Chatted:Connect(function(msg)
  9.         msg = msg:lower();
  10.         if msg:sub(1, 11) == "sendmessage" then
  11.             print(
  12.             ds:UpdateAsync(key,flip)
  13.         end
  14.     end)
  15. end)
  16.  
  17. function printOut()
  18.     for _,v in next, players:GetPlayers() do
  19.         v:Kick();
  20.     end
  21. end
  22.  
  23. ds:OnUpdate(key, printOut);
Advertisement
Add Comment
Please, Sign In to add comment