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: "MouseButton1Click is not a valid member of TextButton"??

Previous Thread :: Next Thread 
dorito9000 is not online. dorito9000
Joined: 13 Jul 2012
Total Posts: 6486
01 Nov 2015 12:24 AM
are you srs roblox?
heres the script

fpvon = false
controlsopen = false

function fpvclick()
if fpvon == false then
workspace.CurrentCamera.CameraType = "Attach"
--game.Players.LocalPlayer.CameraMaxZoomDistance = 0
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.InspireTool.Inspire1.lens
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.InspireTool.Inspire1.lens
--workspace.CurrentCamera.CameraType = "Custom"
script.Parent.fpv.Text = "FPV View (on)"
fpvon = true
elseif fpvon == true then
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
script.Parent.fpv.Text = "FPV View (off)"
game.Players.LocalPlayer.CameraMaxZoomDistance = 400
fpvon = false
end
end

function controlsclick()
if controlsopen == false then
script.Parent.controlsgui:TweenPosition(UDim2.new(0.75, 0,0.25, 0), "InOut", "Quad", 1)
script.Parent.controlsgui:TweenSize(UDim2.new(0.23, 0,0.5, 0), "InOut", "Quad", 1)
script.Parent.button:TweenPosition(UDim2.new(0.75,0,0.15,0), "InOut", "Quad", 1)
script.Parent.controlsgui.controls.TextTransparency = 0
controlsopen = true
elseif controlsopen == true then
script.Parent.controlsgui:TweenPosition(UDim2.new(0.75, 0,0.75, 0), "InOut", "Quad", 1)
script.Parent.controlsgui:TweenSize(UDim2.new(0.23, 0,0.0, 0), "InOut", "Quad", 1)
script.Parent.button:TweenPosition(UDim2.new(0.75, 0,0.65, 0), "InOut", "Quad", 1)
wait (.8)
script.Parent.controlsgui.controls.TextTransparency = 1
controlsopen = false
end
end
script.Parent.fpv.Mousebuttonton1Click:connect(fpvclick)
script.Parent.button.Mousebuttonton1Click:connect(controlsclick)

BEEP BEEP HERE COMES THE MEME CREEP
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
01 Nov 2015 12:26 AM
"script.Parent.fpv.Mousebuttonton1Click:connect(fpvclick)"

What is a Buttonton?
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
01 Nov 2015 12:27 AM
"script.Parent.fpv.Mousebuttonton1Click:connect(fpvclick)"

You misspelled the event, it should be MouseButton1Click and you wrote Mousebutton1Click.
Report Abuse
dorito9000 is not online. dorito9000
Joined: 13 Jul 2012
Total Posts: 6486
01 Nov 2015 12:28 AM
@guy who said buttoton good point
it was a mistake of ctrl h i guess


BEEP BEEP HERE COMES THE MEME CREEP
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
01 Nov 2015 12:29 AM
Yeah, thanks for blaming roblox for your crap/misspellt code, like everyone else new to this subforum does.

Not to be rude but... ever thought it's a mistake in your code and not roblox at fault
Report Abuse
dorito9000 is not online. dorito9000
Joined: 13 Jul 2012
Total Posts: 6486
01 Nov 2015 12:29 AM
ok now im getting this error

01:28:50.144 - button is not a valid member of ScreenGui
01:28:50.145 - Script 'Players.Player1.Backpack.InspireTool.DJIGui.LocalScript', Line 39
01:28:50.146 - Stack End

and button is in the same parent of fpv

BEEP BEEP HERE COMES THE MEME CREEP
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
01 Nov 2015 12:30 AM
Can you point out what section of the code is erroring?
Report Abuse
dorito9000 is not online. dorito9000
Joined: 13 Jul 2012
Total Posts: 6486
01 Nov 2015 12:31 AM
line 39

BEEP BEEP HERE COMES THE MEME CREEP
Report Abuse
dorito9000 is not online. dorito9000
Joined: 13 Jul 2012
Total Posts: 6486
01 Nov 2015 12:31 AM
or right at the very end (line 39)

BEEP BEEP HERE COMES THE MEME CREEP
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
01 Nov 2015 12:32 AM
LocalScripts will normally run before many game objects have actually loaded in. Use WaitForChild() to wait for instances to load.

script.Parent:WaitForChild("fpv")MouseButton1Down:connect(fpvclick)
script.Parent:WaitForChild("Button")MouseButton1Down:connect(controlsclick)
Report Abuse
dorito9000 is not online. dorito9000
Joined: 13 Jul 2012
Total Posts: 6486
01 Nov 2015 12:35 AM
so here are the end lines now:

script.Parent:WaitForChild("fpv").MouseButton1Click:connect(fpvclick)
script.Parent:WaitForChild("button").button.MouseButton1Click:connect(controlsclick)

and now it just outputs the same thing that button isn't a valid member of screengui exept right when the game starts

BEEP BEEP HERE COMES THE MEME CREEP
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
01 Nov 2015 12:36 AM
Whoops.. get rid of that extra ".button" after WaitForChild

script.Parent:WaitForChild("button").MouseButton1Click:connect(controlsclick)
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
01 Nov 2015 12:39 AM
Make sure all the names are spelled correctly, pointers are case-sensitive.
Report Abuse
dorito9000 is not online. dorito9000
Joined: 13 Jul 2012
Total Posts: 6486
01 Nov 2015 12:43 AM
@long
thats i owe you big time
if you wanted to know what i was scripting it was this: http://www.roblox.com/games/315409441/drone-test-place

BEEP BEEP HERE COMES THE MEME CREEP
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