Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My "Instance.new" script in to add an object in the startergui isnt working?

Asked by 6 years ago

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

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 TheSkyofIndia 150 — 6y
0
ik its because its a test after i will put a Text label Pizza64X 8 — 6y

Answer this question