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 » Scripting Helpers
Home Search
 

Re: Gui Brick issues.

Previous Thread :: Next Thread 
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
07 Aug 2014 10:03 PM
I am fairly new to scripting and i have succesfully made a brick that one touched creates or uses a Gui, however i have encountered some difficulties, i have no idea what to script in that makes the Gui disappear on the touching of the brick once more. I would like help please.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
07 Aug 2014 10:45 PM
The wiki should cover basic touching events

http://wiki.roblox.com/index.php?title=Touched_(Event)
Report Abuse
ehern11 is not online. ehern11
Joined: 23 Apr 2011
Total Posts: 1541
07 Aug 2014 10:45 PM
post your script
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
07 Aug 2014 10:50 PM
This is my script


script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
script.Parent.Gui:Clone().Parent = plr.PlayerGui
end
end
end)
Report Abuse
ehern11 is not online. ehern11
Joined: 23 Apr 2011
Total Posts: 1541
07 Aug 2014 10:57 PM
try making it visible/not visible.

plr.PlayerGui.Gui.Frame.Visible = not plr.PlayerGui.Gui.Frame.Visible
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
07 Aug 2014 11:03 PM
It did not seem to work, i am getting a problem that when i walk over it it continues to put gui's up, the gui is on the whole screen and slightly transparent but with all of the guis of that shade popping up it blocks the screen
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
07 Aug 2014 11:05 PM
I didn't even test this
local first = false;
script.Parent.Touched:connect(function(hit)
if not first == true then
first = true;
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil then
plr = game.Players:GetPlayerFromCharacter(hit.Parent);
if first == true then
script.Parent.Gui:Clone().Parent = plr.PlayerGui;
else
plr.PlayerGui.Gui:Destroy();
end
end
end
end
end)
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
07 Aug 2014 11:07 PM
Should i make that a seperate script... or add it to my script? or make a new script to replace mine, im new to this as i said so im not enirely sure.
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
07 Aug 2014 11:14 PM
I somehow get the feeling that it almost worked... but not quite, the Gui's have stopped
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
07 Aug 2014 11:16 PM
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local G = script.Parent.Gui:Clone()
G.Parent = plr.PlayerGui
end end end)


script.Parent.Gui:Clone().Parent = plr.PlayerGui
was always too buggy for my tastes, and you can condense ends
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
07 Aug 2014 11:19 PM
Please good sir tell me where to put thou script!
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
07 Aug 2014 11:21 PM
This script is somethign i threw together since i had no commands, anyone wanna help with it?


script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
script.Parent.Gui:Clone().Parent = plr.PlayerGui
local first = true;
script.Parent.Touched:connect(function(hit)
if not first == false then
first = true;
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil then
plr = game.Players:GetPlayerFromCharacter(hit.Parent);
if first == true then
script.Parent.Gui:Clone().Parent = plr.PlayerGui;
else
plr.PlayerGui.Gui:Destroy();
end
end
end
end
end
end)
Report Abuse
hugthefatman1 is not online. hugthefatman1
Joined: 06 Sep 2012
Total Posts: 1333
07 Aug 2014 11:22 PM
in the brick that your touching
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
07 Aug 2014 11:24 PM
Let me try to make my problem clear, I am getting the Gui to appear, my problem is i want to be able to touch the brick to make it disappear as well as appear and this is proving difficult.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
07 Aug 2014 11:36 PM
OHHH well why didn't you say so.

Gui = "ScreenGui" --Change name to name of gui

DB = 0
script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") then
if DB == 0 then DB = 1
local P = game.Players:GetPlayerFromCharacter(hit.Parent)
if not P.PlayerGui:findFirstChild(Gui) then
local G = script.Parent[Gui]:Clone()
G.Parent = P.PlayerGui
else P.PlayerGui[Gui]:Destroy() end end end wait(1) DB = 0 end)
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
07 Aug 2014 11:37 PM
I already tested it for you and it works fine. Just shove the script and gui into the same brick.
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
07 Aug 2014 11:44 PM
Sorry that didnt work either, i have gotta ge tsoem sleep please tell me any methods you find, thank you all for your help!
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
07 Aug 2014 11:47 PM
If it didn't work then it's because you didn't follow the intructions.
First, you have to change the variable at the top to the name of the gui itself.
Second, you must place BOTH the Script and the ScreenGui into the same part. I already tested this script and it did work. If you're going to ask for help, you have to learn to listen.
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
08 Aug 2014 08:54 AM
I will try again.
Report Abuse
KinzokuButsu is not online. KinzokuButsu
Joined: 22 Feb 2014
Total Posts: 11
08 Aug 2014 08:58 AM
Thank you so much! it worked
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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