Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help on making it so when you do :handto (plr) 1 point is added?

Asked by 5 years ago
Edited 5 years ago

Handto script:

`local Settings = {
    Prefix = ":",
    Group = 4466300,
    Rank = 3,

}
function GetWords(Msg,Pattern)
    local Words = {}
    for w in string.gmatch(Msg, Pattern) do
        table.insert(Words,w)
    end
    return Words
end

local ChatFunctions = {
    ["handto"] = function(Words,Player)
            for _,Target in pairs(game.Players:GetPlayers()) do
                if string.find(string.lower(Target.Name),string.lower(Words[2])) then
                    local Tool = Player.Character:FindFirstChildOfClass("Tool")
                    local Human = Player.Character:FindFirstChildOfClass("Humanoid")
                    if Tool and Human then
                        Human:UnequipTools()
                        wait()
                        Tool.Parent = Target.Backpack
                    end
                end
                wait()
            end
    end,
}

game.Players.PlayerAdded:Connect(function(Player)
    if Player:GetRankInGroup(Settings.Group) >= Settings.Rank then
        Player.Chatted:Connect(function(Message)
            if string.sub(Message,1,1) == Settings.Prefix then
                local Command = GetWords(string.sub(Message,2),"[%w_]+")
                if ChatFunctions[Command[1]] then
            ChatFunctions[Command[1]](Command,Player)
            Player.chatted function = ":handto [player]" 
                end
            end
        end)
    end
end)`

Point save script:

`game.Players.PlayerAdded:connect(function(player)
    local stats = Instance.new("BoolValue",player)
    stats.Name = "leaderstats"

    local Cash = Instance.new("IntValue",stats)
    Cash.Name = "Points"
    Cash.Value = 0

    local rank = Instance.new("StringValue",stats)
    rank.Name = "Rank"
    rank.Value = player:GetRoleInGroup(4466300) 
end)
`
0
You can code this and simply not do: Cash.Value = Cash.Value + 1 greatneil80 2647 — 5y
0
can Optikk 499 — 5y
0
what? GrumpyRoywilson 0 — 5y

Answer this question