generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: my script wont work...

Previous Thread :: Next Thread 
breifmanny is online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
17 Dec 2016 04:56 PM
p = script.Parent
local deb = false
function onTouch(hit)
if deb == false then
deb = true

local title = Instance.new("ScreenGui", game.StarterGui)
local text = Instance.new("Frame", title)

end
end

script.Parent.Touched:connect(onTouch)

When I click play, I see there's a screengui and frame, but it does not seem visible?? Does anyone know why this happens?
Report Abuse
breifmanny is online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
17 Dec 2016 05:07 PM
bump
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
17 Dec 2016 05:10 PM
You need to know the difference between StarterGui and PlayerGui. StarterGui is the GUI players start with, that means that if you probably reset after firing that code, your gui would display. Now in the other hand, PlayerGui is the GUI players CURRENTLY have. Basically, if you wanna make that display on your screen without dying, you'd need to parent it to PlayerGui.


Report Abuse
breifmanny is online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
17 Dec 2016 05:14 PM
It spawns in the playergui, but it still is not visible
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
17 Dec 2016 05:16 PM
show me your code


Report Abuse
breifmanny is online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
17 Dec 2016 05:16 PM

p = script.Parent
local deb = false
function onTouch(hit)
if deb == false then
deb = true

local title = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
local text = Instance.new("Frame", title)

end
end

script.Parent.Touched:connect(onTouch)
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
17 Dec 2016 05:26 PM
is this a local or a server script? are there any errors?


Report Abuse
breifmanny is online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
17 Dec 2016 05:29 PM
I've tried putting it in both normal and local and they both dont work.
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
17 Dec 2016 05:30 PM
where did you put the local one?


Report Abuse
breifmanny is online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
17 Dec 2016 05:31 PM
in a part so when you touch the part it will pop up the gui
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
17 Dec 2016 05:33 PM
noooo sir, put it in StarterPack.
You might want to do instead of script.Parent, do workspace.Part


Report Abuse
breifmanny is online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
17 Dec 2016 05:36 PM
So I put the local script into it, but it still wont work
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
17 Dec 2016 05:37 PM
and you changed what I said?


Report Abuse
breifmanny is online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
17 Dec 2016 05:39 PM
p = script.Parent
local deb = false
function onTouch(hit)
if deb == false then
deb = true

local title = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
local text = Instance.new("Frame", title)

end
end

workspace.Indicator.Touched:connect(onTouch)


I renamed the part Indicator, but I dont think it would matter. p pretty much means nothing, and this is a local scipt in starterpack
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
17 Dec 2016 05:41 PM
ugh this is so weird. could you add a print inside the ontouch function to see if it fires?


Report Abuse
breifmanny is online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
17 Dec 2016 05:44 PM
It fires.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image