Advertisement
Dodikman

Remote Buy

Mar 9th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local symbol = "."
  3. function buyItem(item)
  4. if item == "a" then
  5. game.ReplicatedStorage.Logic.giveitem:FireServer("StandArrow")
  6. end
  7. if item == "r" then
  8. game.ReplicatedStorage.Logic.giveitem:FireServer("RokakakaFruit")
  9. end
  10. end
  11. plr.Chatted:Connect(function(msg)
  12. if string.sub(msg, 1, 1) == symbol then
  13. local toBuy = string.sub(msg, 2)
  14. buyItem(toBuy)
  15. end
  16. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement