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

Why isn't this localscript working? [SOLVED]

Asked by 10 years ago

This script is uses for Startergear. For example I say !Weaponsets sword then it puts it in the starter gear so when you die you will still have it.

names = {"GTDRIVER"}    -- Add in the names of the people you want to be able to use the command script here.}

game.Players.PlayerAdded:connect(function(player)
    for i, v in pairs(names) do
        if v == player.Name then
            player.Chatted:connect(function(chatmsg)
                if chatmsg:sub(1,4) == "!Weaponsets" then
                  tool = game.ReplicatedStorage.tool
                   tool = tool:Clone()
                     tool.Parent = plr.StarterGear
                end
0
Please edit your post and place your code in a Code Block to make it easier for users to answer your question. bbissell 346 — 10y
0
Also, don't just post code, provide both an explanation and code. Spongocardo 1991 — 10y
0
That is still not correct. bbissell 346 — 10y

1 answer

Log in to vote
2
Answered by 10 years ago

You did msg:sub(1,4) it should be msg:sub(1,11) since your string is 11 digits long

Ad

Answer this question