Tesouro
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 1284 |
|
|
| 06 Oct 2011 01:31 PM |
i need a script that when i touch a brick, it opens a Gui Help! |
|
|
| Report Abuse |
|
|
werty1237
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 72 |
|
|
| 06 Oct 2011 01:39 PM |
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
user = game.Players:findFirstChild(human.Parent.Name)
script.Parent.NAME OF GUI:clone().Parent = player.PlayerGui
wait(2)
else
wait(2)
debounce = false
end
end
script.Parent.Touched:connect(onTouch)
All you need to do is put this in the brick in a script with the gui INSIDE of the brick.
Do not use below B00M |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2011 01:52 PM |
| @werty Learn to make readable code. |
|
|
| Report Abuse |
|
|
juriaan
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 939 |
|
|
| 06 Oct 2011 01:55 PM |
@Werty. learn to make your Own Scripts..
|
|
|
| Report Abuse |
|
|
werty1237
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 72 |
|
|
| 06 Oct 2011 02:04 PM |
| @juriaan I've tried to learn and I get them but I can't make them |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2011 02:59 PM |
| Don't help people with free models... |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2011 03:04 PM |
cow = kow = game:findFirstChild(tostring(cow), true) gui =
kow.Touched:connect(function(s) k = game.Players:playerFromCharacter(s.Parent) if k.Humanoid then if k.PlayerGui[gui] then k.PlayerGui[gui].Visible = true end end end) |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 06 Oct 2011 03:20 PM |
| No requests allowed!!!! xDDD |
|
|
| Report Abuse |
|
|
Tesouro
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 1284 |
|
|
| 06 Oct 2011 06:22 PM |
guys, if u arent here to help, dont post comments If theres a scripting Forum, its to be used and to experienced ppl help others |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2011 06:25 PM |
| Well, making scripts for other people who have no idea how to script doesn't do anything. |
|
|
| Report Abuse |
|
|
Tesouro
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 1284 |
|
|
| 06 Oct 2011 07:00 PM |
| i have a basic knowing about scripts, but i need help to make them |
|
|
| Report Abuse |
|
|
Tesouro
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 1284 |
|
|
| 06 Oct 2011 07:01 PM |
| ah, and i know how to search free models, ok? |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 07 Oct 2011 04:32 PM |
| So search it and learn it! WHATTA A RYTHME XDDD |
|
|
| Report Abuse |
|
|
Tesouro
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 1284 |
|
| |
|
|
| 09 Oct 2011 10:09 AM |
function ontouched(hit) if (hit.Parent:findFirstChild("Humanoid")~=nil) then game.Players:findFirstChild(hit.Parent.Name).PlayerGui.gui.gui2.Visible = true end end script.Parent.Touched.connect(ontouched) |
|
|
| Report Abuse |
|
|
DXPower
|
  |
| Joined: 21 Oct 2008 |
| Total Posts: 2866 |
|
|
| 09 Oct 2011 10:30 AM |
put an invisabe GUI in starter gui
use the argument hit to locate the character
find the gui in starter gui
have it change the visibilty
go in my models
take the onTouch GUI |
|
|
| Report Abuse |
|
|