Everything here works except line 8/9, where I gave my best shot at trying to find the userId of the player that I wanted to give it to. Any ideas how to give them the points?
Ex: In game I would say '/points cardboardrocks' and it would give cardboardrocks 1 PP (The bolded thing: :AwardPoints(b, **1**)
keyword = "/points" game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if string.find(msg:lower(), keyword) then print("Found "..keyword) a = msg:sub(8, msg:len()) print(a) playerschildren = game.Players:GetChildren() for i = 1, #playerschildren do if playerschildren[i].Name == a then b = playerschildren[i].userId print(b) end end game:GetService("PointsService"):AwardPoints(b, 1) end end) end)
You should to do it:
/awarp [player name] [how much of points]
awarp = AWARd Points
Example: /awarp JoLLDS 50 = will give 50 PlayerPoints to JoLLDS
Do it:
keyword = "/awarp" game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if string.find(msg:lower(), keyword) then print("Found "..keyword) a = msg:sub(6, msg:len()) print(a) playerschildren = game.Players:GetChildren() for i = 1, #playerschildren do if playerschildren[i].Name == a then b = playerschildren[i].userId print(b) end end a = msg:sub(6 + #playerschildren[i].Name + 1, msg:len()) game:GetService("PointsService"):AwardPoints(b, a) end end) end)
Warning: this script was untested, so, a error can be caused, pay attention on the Output window
Both of the scripts above would not work because the server doesn't know how many points is awardable!
~100 bottles of bloxy cola on the wall