i had a script that would insert a script into my screen gui but it doesnt work heres my script: and in the output it was saying "LevelGui is not a valid member of StarterGui"

script.Parent.Touched:connect(function(hit)
 if hit ~= nil then
  local char = hit.Parent
  if char ~= nil then
   local humanoid = char:FindFirstChild("Humanoid")
   if humanoid ~= nil then
    game.StarterGui.LevelGUI = Instance.new ("Script")
   end
  end
 end
end)

and "LevelGui" is a ScreenGui that i added in the StarterGuy

2 comments

1

why are you creating it in StarterGui ? you should make it in the PlayerGui else the player will need to respawn before he can see the new thing

0

ik its because its a test after i will put a Text label