Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isn't this localscript working? [SOLVED]

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

3 comments

0

Please edit your post and place your code in a Code Block to make it easier for users to answer your question.

0

Also, don't just post code, provide both an explanation and code.

0

That is still not correct.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.