I'm attempting to make a script that will move a script to somewhere else, and insert a script into it, it would take a bit of time to do this in more than one script, so I'm trying to save time by doing it in one.
I am needing help with the part that involves inserting a selected script into the script.
a = Instance.new("LocalScript",game.Workspace) --Creates a localscript in workspace
a.Name = ("LSName") --Changes the localscripts name.
chatt = game.Players.LocalPlayer --This is the player the command will go to
function onChatted(msg) --This is the function for the chat command
if msg == "InsertMessage" then --This is the message the player must say for the script to happen
--This is the script that will happen if the command is said
end
end
chatt.Chatted:connect(onChatted) --This connects the function
local var = game.Workspace.LSName:Clone() --This clones the script this is in to var's parent in line 17
var.Parent = game.StarterPlayer.StarterPlayerScripts --This is the target for line 16
