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

Where do I put a local script using live code?

So, I'm currently trying to make a require module script that, when used in the dev console, would enable a user input service script, but the thing is, I clone it, and I don't know where to put it! I've tried the player character, I've tried the player, I've tried startercharacterscripts, I've tried starterplayerscripts, but nowhere it seemed to work. So where do I put the UserInputService script? (By the way, just incase this is wrong, it clones all the children in the module script + the module script, that might be the problem but I don't know (It puts all the children in the module script))

Script I'm Using:

local module = {}

function module.Owner(owner)
	local playerOwner = game:GetService("Players"):FindFirstChild(owner)
	local clone = script:Clone()
	clone.Parent = game.StarterPlayer.StarterPlayerScripts
	script:WaitForChild("FindModulePlayer"):Fire(playerOwner)
end

return module

1 comment

0

Please encase your code in Lua tags (look for the Lua icon when editing or creating a question/answer). I did it for you this time.

1 answer

Module scripts don't run on their own. Here is a link to Module Scripts on the Roblox developer hub.

1 comment

0

Yes, I know that, I'm requiring the script using the developer console.

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