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: GUI Scripting

Previous Thread :: Next Thread 
DevKonner is not online. DevKonner
Joined: 04 Feb 2012
Total Posts: 519
18 Apr 2015 08:41 AM
How do I make a script to where you step inside a block (The block is not CanCollided ) and a GUI pops up in the middle of you screen. Can someone help me?
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
18 Apr 2015 08:43 AM
have the gui invisible and use the Touched event to make it visible
use the TouchEnded event to make it invisible again
Report Abuse
DevKonner is not online. DevKonner
Joined: 04 Feb 2012
Total Posts: 519
18 Apr 2015 08:48 AM
I cant find anything on the wiki regurading touch events
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
18 Apr 2015 08:50 AM
okay... is your gui in startergui?
Report Abuse
DevKonner is not online. DevKonner
Joined: 04 Feb 2012
Total Posts: 519
18 Apr 2015 08:51 AM
Yeah
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
18 Apr 2015 08:56 AM
Place it on your screen where you want it to pop up and make sure that Visible is unchecked.

part = --part location here
gui = --gui location here

part.Touched:connect(function()
gui.Visible = true
end

part.TouchEnded:connect(function()
gui.Visible = false
end
Report Abuse
SeizureMadness is not online. SeizureMadness
Joined: 23 Apr 2011
Total Posts: 154
18 Apr 2015 08:59 AM
That will make it global, use :GetPlayerFromCharacter() instead.
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
18 Apr 2015 09:02 AM
^ or put it in a localscript.
Report Abuse
SummerEquinox is not online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
18 Apr 2015 09:19 AM
Chrap

That doesn't work (Its an anonymous function)

therefor those ends need to be end) not end.
Report Abuse
DevKonner is not online. DevKonner
Joined: 04 Feb 2012
Total Posts: 519
18 Apr 2015 09:20 AM
part = brick--part location here
gui = ScreenGUI--gui location here

part.Touched:connect(function()
gui.Visible = true
end

part.TouchEnded:connect(function()
gui.Visible = false
end

"Part" in line 8 is giving me a red line saying:

"Expected ')' (to close ')' at line 4) got,'part'
Report Abuse
SummerEquinox is not online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
18 Apr 2015 09:22 AM
This is what I just said

Here:

part = brick--part location here
gui = ScreenGUI--gui location here

part.Touched:connect(function()
gui.Visible = true
end)

part.TouchEnded:connect(function()
gui.Visible = false
end)
Report Abuse
DevKonner is not online. DevKonner
Joined: 04 Feb 2012
Total Posts: 519
18 Apr 2015 09:49 AM
Not working
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
18 Apr 2015 09:54 AM
local debounce = false
function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then
debounce = true
local player = getPlayer(human)
if (player == nil) then return end
script.Parent:clone().Parent = player.PlayerGui
wait(2)
debounce = false
end
end
script.Parent.Parent.Touched:connect(onTouch)

put gui in brick with this in it


God grant me the wisdom to not punch stupid ppl, for I know I will go to prison.
Report Abuse
MajikkuSoul is not online. MajikkuSoul
Joined: 15 Feb 2014
Total Posts: 196
18 Apr 2015 10:09 AM
local gui = locationofgui
local guiname = 'GUI name''
guib = false

script.Parent.Touched:connect(function(hit)
if guib == false then
local x = gui:Clone()
x.Parent = game.Players:GetPlayerFromCharacter(hit.Parent).PlayerGui
guib = true
else
script.Parent.TouchEnded:connect(function(hit)
if guib == true then
game.Players:GetPlayerFromCharacter(hit.Parent).PlayerGui[guiname]:remove()
guib = false
end
end)
end
end)

Won't this work too?


~ All you need to know is that I'm an otaku
Report Abuse
MajikkuSoul is not online. MajikkuSoul
Joined: 15 Feb 2014
Total Posts: 196
18 Apr 2015 10:10 AM
Dam double ''


~ All you need to know is that I'm an otaku
Report Abuse
MajikkuSoul is not online. MajikkuSoul
Joined: 15 Feb 2014
Total Posts: 196
18 Apr 2015 10:10 AM
local guiname = 'GUI name' ***


~ All you need to know is that I'm an otaku
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