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

Is there a way to delete a script that was loaded in via loadstring()?

Hey guys! Haven't asked a question in quite a while, but this topic happened to cross my mind. Say I load a script in via loadstring() and I then want to disable it/delete it, how would I do so? I've tried script.Disabled within the loadstring, but it didn't seem to work. I plan to have several scripts loaded in via loadstring(), and some will need to disable/delete itself so it doesn't lag up the game. Any suggestions?

1 comment

0

Welp, someone answered it for me on discord. The answer is no

1 answer

✓ Accepted answer

No. loadstring doesn't create a new Script object, it simply interprets a string and returns a function to execute it. Furthermore, it is not a Roblox feature, it is a standard Lua function.

4 comments

0

I didn't want that to be the answer qq. I knew it in my head, but I prayed to Telamon (not shedletsky, telamon is elite) that there was another way.

1

'Should've prayed to Builderman.

0

Dude, naw. Telamon was og. Screw shedletsky, username changing thing screwed everything up.

0

@LordDragonZord I agree.

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