But when I try to change 'run/' it doesn't work when I change it?
current_map = nil names = {"iSidersz"} 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) == "run/" then local map = chatmsg:sub(5, chatmsg:len()) if game.Lighting:FindFirstChild(map) then if current_map ~= nil then current_map.Parent = game.Lighting end game.Lighting[map].Parent = game.Workspace current_map = game.Workspace[map] end end end) end end end)
Let's look at the code. This line here:
if chatmsg:sub(1,4) == "run/" then
It's checking if the first 4 characters of the chatmsg string are equal to "run/". What you are probably doing when you edit the script is you are changing "run/" to something longer than 4 characters. In that case, you need to update the 4 to the length of the string. The same goes for the 5 in the next line.
A clearer way to do this:
if chatmsg:sub(1, string.len("run/")) == "run/" then local map = chatmsg:sub(string.len("run/")+1, chatmsg:len())