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: MouseClick not working

Previous Thread :: Next Thread 
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
10 Jul 2012 02:01 PM
using the line: script.Parent.ClickDetect.MouseClick:connect(onClicked)
It gives no errors yet it does nothing, I have a print("Work") below the function but it does not print so its getting stuck at ClickDetect. Anyone know why?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Jul 2012 02:02 PM
    script.Parent.ClickDetector.MouseClick:connect(onClicked)

> † KMXD †
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
10 Jul 2012 02:02 PM
Make sure you end) it correctly and that there is a ClickDetector inside the brick being clicked.
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
10 Jul 2012 02:04 PM
The name is correct, i changed the ClickDetector name to ClickDetect. There is a ClickDetector in there otherwise output would show an error. What do you mean end it correctly?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Jul 2012 02:05 PM
@White

I think it's the fact that he put "ClickDetect".

> † KMXD †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Jul 2012 02:05 PM
@352

Please post more code then.

> † KMXD †
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
10 Jul 2012 02:05 PM
Is that your connection line or are you using an anonymous function?
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
10 Jul 2012 02:06 PM
function onClicked()
print("Start")
if script.Parent.Parent.Parent.Active.Value == false then
if script.Parent.Parent.Parent.State.Value == false then
script.Parent.Parent.Parent.State.Value = true
end
if script.Parent.Parent.Parent.State.Value == true then
script.Parent.Parent.Parent.State.Value = false
end
end
end

script.Parent.ClickDetect.MouseClick:connect(onClicked)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Jul 2012 02:06 PM
@White

It's not an anonymous function...

> † KMXD †
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
10 Jul 2012 02:06 PM
Everything is in place so dont ask that.
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
10 Jul 2012 02:08 PM
Well I thought that he as trying to implement an anonymous function as he never stated if it was his connection line or what.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Jul 2012 02:08 PM
    function onClicked()
    print("Start")
         if not script.Parent.Parent.Parent.Active.Value
              if not script.Parent.Parent.Parent.State.Value then
              script.Parent.Parent.Parent.State.Value = true
              elseif script.Parent.Parent.Parent.State.Value then
              script.Parent.Parent.Parent.State.Value = false
              end
         end
    end
    script.Parent.ClickDetect.MouseClick:connect(onClicked)

> † KMXD †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Jul 2012 02:09 PM
oops

    function onClicked()
    print("Start")
         if not script.Parent.Parent.Parent.Active.Value then
              if not script.Parent.Parent.Parent.State.Value then
              script.Parent.Parent.Parent.State.Value = true
              elseif script.Parent.Parent.Parent.State.Value then
              script.Parent.Parent.Parent.State.Value = false
              end
         end
    end
    script.Parent.ClickDetect.MouseClick:connect(onClicked)

> † KMXD †
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
10 Jul 2012 02:12 PM
neither work, i tried this:
function onClicked()
print("Start")
if not script.Parent.Parent.Parent.Active.Value == true then
print("Dos")
if not script.Parent.Parent.Parent.State.Value == true then
print("RO")
script.Parent.Parent.Parent.State.Value = true
end
if not script.Parent.Parent.Parent.State.Value == false then
script.Parent.Parent.Parent.State.Value = false
end
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

then i got to print("RO") then it didnt work.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Jul 2012 02:16 PM
    function onClicked()
    print("Start")
    if not script.Parent.Parent.Parent.Active.Value == true then
    print("Dos")
    if not script.Parent.Parent.Parent.State.Value == true then
    print("RO")
    script.Parent.Parent.Parent.State.Value = true
    elseif not script.Parent.Parent.Parent.State.Value == false then
    script.Parent.Parent.Parent.State.Value = false
    end
    end
    end
    script.Parent.ClickDetector.MouseClick:connect(onClicked)

> † KMXD †
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
10 Jul 2012 02:31 PM
That semi-worked. did alteration to it.
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