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
 

Shop | onTouch | TouchEnded

Previous Thread :: Next Thread 
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
15 Aug 2014 08:56 PM
So I'm having a bit of trouble here. When you touch it, you get the gui. The only problem is Touch Ended isn't working. (I also need to learn how to compile many scripts into one script, and this is one of those times) Another thing is that I need to make it only give you 1 gui at max. At the moment it gives you a lot. I think I can fix that though. Here's the code.



local gui = game.ReplicatedStorage.AmmunationGui

-- Touches

function onTouch(part)
local user = Game.Players:findFirstChild(part.Parent.Name)
gui:clone().Parent = user.PlayerGui
end

script.Parent.Touched:connect(onTouch)

-- Walks away

function WalkAway(TouchEnded)
local user = Game.Players:findFirstChild(part.Parent.Name)
user.PlayerGui.AmmunationGui:remove()
end

script.Parent.TouchEnded:connect(WalkAway)
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
15 Aug 2014 09:01 PM
Oh god another gta 5 game
Oh well, I can't judge
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
15 Aug 2014 09:02 PM
@Tripane

Well, if I'm in scripting helpers, that means it's better than 100% of the other GTA games out there.

Am I wrong?
Report Abuse
Excession is not online. Excession
Joined: 09 Sep 2011
Total Posts: 2674
15 Aug 2014 09:05 PM
@AntiFiter

Yes, you are
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
15 Aug 2014 09:06 PM
Fair point

Instead of all this touch stuff, try magnitude instead. I find it easier

I can't give you a true example, I'm not at a computer currently

Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
15 Aug 2014 09:06 PM
I don't know much about magnitude. I'll look at a wiki in the morning.
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