So i was making a special GUI for my character and i wanted to insert a script on it, the thing is: Can i edit a LocalScript's content with a script?
The Script:
script.Parent.ChildAdded:Connect(function()
do
--Gui
Instance.new("ScreenGui")
Instance.Name = "Hi"
Instance.Parent = game.Players.RedLecko434.PlayerGui
--Button
Instance.new("TextButton")
Instance.Parent = game.Players.RedLecko434.PlayerGui.Hi
Instance.Name = "ButtonTxSg"
Instance.Position = {0.905, 0},{0.801, 0}
--Script
Instance.new("LocalScript")
Instance.Parent = game.Players.RedLecko434.PlayerGui.Hi.ButtonTxSg
end
end)
Also if it isnt possible, could something like this work?
script.Parent.ChildAdded:Connect(function()
do
game.ServerStorage.SampleScirpt:GetChildren("RedLecko434")
end
end
Good luck.

6 comments
wtf
?
?
No, you cannot edit a script's source at all with another script. Btw, you should define the obj with a variable; it's not changing the
NameorParent, you're doingCreate ScreenGui, now try and indexNametoInstance, and finally try and indexParenttoInstance.I recommend you read this. https://developer.roblox.com/articles/Create-Parts-via-Code
Thanks for the help.