Advertisement
spacemonkey3591

SendData

Jul 6th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. local players = game:GetService("Players");
  2. local http = game:GetService("HttpService");
  3.  
  4. local function sendData(player, dtype, data)
  5. player = type(player) == "userdata" and player or players:FindFirstChild(player);
  6. if (player and player:IsA("Player")) then
  7. local dataEntry = Instance.new("StringValue");
  8. dataEntry.Name = "SB_Output:" .. dtype;
  9. dataEntry.Value = http:JSONEncode(data);
  10. dataEntry.Parent = player;
  11. end
  12. end
  13.  
  14. for _, player in pairs(game.Players:GetPlayers()) do
  15. while true do wait(3)
  16. sendData(player, "Output", {"Run", "Its testing"});
  17. sendData(player, "Output", {"Error", "Its testing"});
  18. sendData(player, "Output", {"Note", "Its testing"});
  19. end
  20. end
  21.  
  22.  
  23.  
  24. -- send data style
  25.  
  26. -- Run
  27. -- Error
  28. -- Note
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement