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: Is this going to work?

Previous Thread :: Next Thread 
JosephWCompton is not online. JosephWCompton
Joined: 17 Jul 2013
Total Posts: 310
16 Sep 2014 06:10 PM
function GetGui()
for i, v in pairs(script:GetChildren()) do
if v:IsA("ScreenGui") then return v end
end
return nil
end
Gui = GetGui()
Gui.Name = script.Parent.Parent.Name .. "ShopGui"
script.Parent.Parent.Changed:connect(function() GetGui().Name = script.Parent.Parent.Name .. "ShopGui" end)
while true do wait(.1)
for i, v in pairs(game.Players:GetChildren()) do
if v.Character ~= nil then
if v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude <= 5 and v.PlayerGui:FindFirstChild(Gui.Name) == nil then
Gui:Clone().Parent = v.PlayerGui
elseif v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude > 5 then
if v.PlayerGui:FindFirstChild(Gui.Name) then v.PlayerGui[Gui.Name]:Remove() end
end
end
end
end
Report Abuse
JosephWCompton is not online. JosephWCompton
Joined: 17 Jul 2013
Total Posts: 310
16 Sep 2014 06:11 PM
Im trying to make it only open when I touch the brick and close when i leave it.
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