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: Whats wrong with this script? It only works on one person?

Previous Thread :: Next Thread 
XxShayexX is not online. XxShayexX
Joined: 03 May 2009
Total Posts: 2180
10 Mar 2012 10:17 PM
function OnTouch(part)
local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
local check = game.Players:findFirstChild(part.Parent.Name)
local gui = check.PlayerGui.Market.MainFrame
gui.Visible = true
end
end

script.Parent.Touched:connect(OnTouch)

I know its the part that says findFirstChild but I dont get what to change it too
I want it so anyone can touch it and what I want will happen, happens, not with just the first person who presses it
Report Abuse
bl5eebryce is not online. bl5eebryce
Joined: 03 Aug 2009
Total Posts: 387
10 Mar 2012 10:21 PM
Those types of functions always cause trouble. Use this instead. Not too different.

script.Parent.Touched:connect(function(part)
local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
local check = game.Players:findFirstChild(part.Parent.Name)
local gui = check.PlayerGui.Market.MainFrame
gui.Visible = true
end
end)

Yeah. I'm sure you have a pretty good scripting knowledge. You get how this works right?
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
10 Mar 2012 10:25 PM
@bl5, you do not know your stuff.... ​>.> you just changed the function to an anonymous one. that makes virtually no difference to the script...

~would you like some butter with your late toast?
Report Abuse
XxShayexX is not online. XxShayexX
Joined: 03 May 2009
Total Posts: 2180
10 Mar 2012 10:34 PM
Confused, is Bl5's right or not?
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
10 Mar 2012 10:35 PM
it's not, he just changed some of the code formatting...

~would you like some butter with your late toast?
Report Abuse
XxShayexX is not online. XxShayexX
Joined: 03 May 2009
Total Posts: 2180
10 Mar 2012 10:38 PM
Well do you know how to fix it then?
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
10 Mar 2012 11:05 PM
the script itself is perfectly fine, is it possible that not everyone has that GUI?

~would you like some butter with your late toast?
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