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: Help

Previous Thread :: Next Thread 
Gahdzilla is not online. Gahdzilla
Joined: 09 Jun 2016
Total Posts: 351
01 Oct 2016 05:46 PM
Ok so I put this script into a brick. I want to be able to open a Gui when somebody clicks a brick. Please let me know how to fix this.

This is what i have.

local tipgui1 = game.Player.LocalPlayer.PlayerGui.TipGui

function onClicked()
if script.Parent.Anchored == true
then

tipgui1.TipFrame.Visible = true

end
end
script.Parent.MouseButton1Down:connect(onClicked)


I'm still learning and the help would be much appreciated please let me know what i did wrong as well.


Report Abuse
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
01 Oct 2016 05:55 PM
You use MouseClick and a ClickDetector on a part to detect someone clicking it, which returns the player who clicked it so there's no need to use a local script:

script.Parent.ClickDetector.MouseClick:connect(function(plyr)
local gui = plyr.PlayerGui.TipGui
gui.TipFrame.Visible = true
end)
Report Abuse
Gahdzilla is not online. Gahdzilla
Joined: 09 Jun 2016
Total Posts: 351
01 Oct 2016 05:59 PM
Thanks so much!


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