How to i inject scripts into workspace with a plugin

i do not know how to use inject
basically I’m making a anti cheat and when a player presses confirm a script will go into serverscriptstorage
but I cant figure out the code needed to make this happen

I looked around and asked some people and found no answers

1 Like

You’re making an anti-cheat that allows players to inject scripts into the game?

Isn’t that counterintuitive?

2 Likes

What are your intentions? Injecting a script into ServerStorage or into Workspace? Also, anti-cheat? It doesn’t make sense.

thats all im trying to do by automating the creation

just have the script disabled in like some random nested part and then clone it and enable it and set its parent to serverscriptservice

like this:

local script = game.Workspace.Model.Model.Model.Model.Model.Model.Model.Model.AntiCheat -- change this to where you put it.
local button = script.Parent.Button
button.MouseButton1Click:Connect(function()
local new = script:Clone()
new.Parent = game.ServerScriptService
new.Enabled = true
end)