So actually I watched a video from RoScripter “AddPoints” but I want to remove them tho actually how can I do that?
Can you show me your script please!?
Yeah sure here:
local GroupId = 10878583
local MinimumRankToUseCommand = 243
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(GroupId) >= MinimumRankToUseCommand then
Player.Chatted:Connect(function(Message)
local Words = string.split(Message, " ")
if Words[1] == "!addpoint" then
local NameOfPlayerToGivePoint = Words[2]
local AmountOfPointsToGive = Words[3]
local PlayerToGivePoint = game.Players:FindFirstChild(NameOfPlayerToGivePoint)
if PlayerToGivePoint then
PlayerToGivePoint.leaderstats.Points.Value = PlayerToGivePoint.leaderstats.Points.Value + AmountOfPointsToGive
end
end
end)
end
end)
Add a new script to ServerScriptService
And put this inside the script:
local GroupId = 10878583
local MinimumRankToUseCommand = 243
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(GroupId) >= MinimumRankToUseCommand then
Player.Chatted:Connect(function(Message)
local Words = string.split(Message, " ")
if Words[1] == "!removepoint" then
local NameOfPlayerToGivePoint = Words[2]
local AmountOfPointsToGive = Words[3]
local PlayerToGivePoint = game.Players:FindFirstChild(NameOfPlayerToGivePoint)
if PlayerToGivePoint then
PlayerToGivePoint.leaderstats.Points.Value = PlayerToGivePoint.leaderstats.Points.Value - AmountOfPointsToGive
end
end
end)
end
end)
This will run anytime you say “!removepoint” and you have the right role in the group!
Thanks it worked! Also i need to write the whole name of the person but i actually wanna write: ex. ‘rob’ and not ‘ROBLOX’ could you help me with that?
This is a bit more challenging.
If you give me a bit of time I will try to work it out, ok?
I think I may have found something!
Give me some time!
Try this for the remove point system!
function FindPlayer(name) -- name = string provided to look for player
for i,v in pairs(game.Players:GetPlayers()) do -- iterating though players
if v.Name:lower():sub(1,#name) == name:lower() then -- checking to see if player name matches the provided string
return v -- returns the player it finds
end
end
end
local GroupId = 10878583
local MinimumRankToUseCommand = 243
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(GroupId) >= MinimumRankToUseCommand then
Player.Chatted:Connect(function(Message)
local Words = string.split(Message, " ")
if Words[1] == "!removepoint" then
local NameOfPlayerToGivePoint = Words[2]
local AmountOfPointsToGive = Words[3]
local PointsGiveToUser = FindPlayer(NameOfPlayerToGivePoint)
local PlayerToGivePoint = game.Players:FindFirstChild(PointsGiveToUser)
if PlayerToGivePoint then
PlayerToGivePoint.leaderstats.Points.Value = PlayerToGivePoint.leaderstats.Points.Value - AmountOfPointsToGive
end
end
end)
end
end)
I put the script in but it didnt work…
Can you show me the output please?
Try this for the RemovePoint script again:
local GroupId = 10878583
local MinimumRankToUseCommand = 243
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(GroupId) >= MinimumRankToUseCommand then
Player.Chatted:Connect(function(Message)
local Words = string.split(Message, " ")
if Words[1] == "!removepoint" then
print("Ok!")
local NameOfPlayerToGivePoint = Words[2]
local AmountOfPointsToGive = Words[3]
for i,v in pairs(game.Players:GetPlayers()) do -- iterating though players
if v.Name:lower():sub(1,#NameOfPlayerToGivePoint) == NameOfPlayerToGivePoint:lower() then -- checking to see if player name matches the provided string
PointsGiveToUser = v
end
end
local PlayerToGivePoint = game.Players:FindFirstChild(PointsGiveToUser)
if PlayerToGivePoint then
print("Worked!")
PlayerToGivePoint.leaderstats.Points.Value = PlayerToGivePoint.leaderstats.Points.Value - AmountOfPointsToGive
end
end
end)
end
end)
It doesnt work but this stand on the output
WAIT!
I HAD A BRAIN SPARK
I KNOW!
Wait I didn’t. ;-; I need to think…
I think I’m onto it ttho…
nvm! I dont need it, its alright like this thanks!
how can i make a groupnametag? above you head because i watched RoScripters Video but it didnt work, It worked but only for me… Could you help me?
Sure!
Make a new topic tho.
This topic was automatically closed after 7 days. New replies are no longer allowed.