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: In-Game clicked function not working?

Previous Thread :: Next Thread 
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 01:55 PM
So this is a very simple script but for some reason it doesn't work in game it only works in studio?
Any ideas?
If more info needed i would be happy to reply.


function OnClick()
script.Parent.Visible = false
script.Parent.Parent.Save.Visible = true


end

script.Parent.Save.ImageButton.MouseButton1Click:connect(OnClick)

Thanks
Trouble
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 02:03 PM
Well here a bump....

And it is a localscript


If more info is needed i would be happy to reply.

Thanks
Trouble
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 02:20 PM
Bump....

:/


Thanks
Trouble
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 02:33 PM
Another Bump...

And btw there is no error in the output.

Thanks
Trouble
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 02:47 PM
just post the location and the name of everything you want to change.
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 02:50 PM
also your problem might be that Save may not be the parent of the script.
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 02:52 PM
Thanks for the help.

But i think that i found the problem:script in-game hasn't found the gui who should become visible so i just need to add a WaitForChild but thanks :).

I will test it tommorow and if it won't work i'll come back.

Thanks Trouble
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 02:52 PM
wait nvm I didnt read all of it
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 02:54 PM
you need to take a clean look on the line that connects the function
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 02:54 PM
you need to take a keen look on the line that connects the function
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 02:54 PM
I have no idea why I posted clean

lmao
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 03:16 PM
Ok so this is weird. function OnClick() local truck = game.Workspace:FindFirstChild(player.Name.."truck") wait(0.2) truck:Destroy() wait(0.5) end script.Parent.Parent.Re.Truck.R.MouseButton1Click:connect(OnClick) this script is also in the same localscript but it has an error it says that Re isn't a valid member of the frame. But it is. here you can see the locations ################################################## If more info is needed i would be happy to reply. Thanks Trouble
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 03:19 PM
what is that? lmao
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 03:19 PM
ok so it hashtagged the link

but here are the locations with words

-Tablet(Frame)(Parent for Main, Save and Re)
-Main(Frame)
LocalScript
textbuttons
-Save(Frame)
-Re(Frame)
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 03:20 PM
function OnClick()
local truck = game.Workspace:FindFirstChild(player.Name.."truck")
wait(0.2)
truck:Destroy()



wait(0.5)
end

script.Parent.Parent.Re.Truck.R.MouseButton1Click:connect(OnClick)

here's the script which has the error in the output saying Re is not a valid member of Frame.
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 03:20 PM
basically if u dont have "truck" you will be deleting the player which is another way of kicking the player from the game
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 03:21 PM
nvm I need to pay more attention to these
Im so off today
Report Abuse
OAuth2 is not online. OAuth2
Joined: 27 Nov 2016
Total Posts: 751
03 Jan 2017 03:22 PM
WaitForChild

Everything loads slower in game than solo test.


Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 03:22 PM
:D

YEA, but what about the the error of Re not being a valid member of frame but it is.
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 03:22 PM
^
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 03:23 PM
Does waitforchild work in LocalScripts?
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Jan 2017 03:23 PM
Obviously why would u ask that?
Report Abuse
OAuth2 is not online. OAuth2
Joined: 27 Nov 2016
Total Posts: 751
03 Jan 2017 03:23 PM
"script.Parent.Parent.Re.Truck.R.MouseButton1Click:connect(OnClick)"
to
script.Parent.Parent:WaitForChild("RE").Truck.R.MouseButton1Click:connect(OnClick)


Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
03 Jan 2017 03:24 PM
A friend of mine once told me that WaitForChild in localscripts don't work(or maybe tho's were normal scripts.) So yea ok i'll test that.

Thanks!
Report Abuse
OAuth2 is not online. OAuth2
Joined: 27 Nov 2016
Total Posts: 751
03 Jan 2017 03:25 PM
@Gomlsauresrex

Stop giving him wrong information. WaitForChild works for both scripts and localscripts, server or client.


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