Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 23 May 2014 09:05 AM |
I have a script inside of a ClickDetection inside a Part
script.Parent.Touched:connect(function(hit) char = hit.Parent:FindFirstChild("Humanoid") player = game.Players:GetPlayerFromCharacter(char.Parent) phonez = player.PlayerGui.phone
if phonez.questgroup.back1.all.b.Visible == true and phonez.questgroup.back2.all.b.Visible == false and phonez.questgroup.back3.all.b.Visible == false then
phonez.questgroup.back1.all.b.Visible = false phonez.questgroup.back1.all.b.Visible = true phonez.questgroup.back1.all.b.Visible = false phonez.newquest.Transparency = 1 phonez.newquest.Transparency = 1 phonez.newquest.Transparency = 1 phonez.newquest.Transparency = 1 phonez.newquest.Transparency = 1 phonez.newquest.Transparency = 1 phonez.newquest.Transparency = 1 phonez.newquest.Transparency = 1 phonez.newquest.Transparency = 1 phonez.newquest.Transparency = 1
end end)
It doesn't seem to work, but it gives me the click icon when hovering over it. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 May 2014 09:25 AM |
May I ask why you set the transparency to 1 10 times?
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::] |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 23 May 2014 09:27 AM |
| I'm changing that, The first line is where the problem is I think. |
|
|
| Report Abuse |
|
|
|
| 23 May 2014 09:29 AM |
| Why don't you have any wait's? I don't believe you'd notice it working if you don't add some sort of pause in the script. |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 23 May 2014 09:30 AM |
| Should the first line be Touched If it is being clicked? |
|
|
| Report Abuse |
|
|
|
| 23 May 2014 09:32 AM |
| If this was in a click function it would be a problem, however this supposed to run only to a touched function. |
|
|
| Report Abuse |
|
|
|
| 23 May 2014 09:33 AM |
| Wait, the function is connected to the Click Detector, er, not a good idea if you ask me. That may be why it's not working. |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 23 May 2014 09:34 AM |
| How would I make it a click function? |
|
|
| Report Abuse |
|
|
|
| 23 May 2014 09:37 AM |
You would use the MouseClicked event instead of the .Touched event. Since the MouseClicked event has the player who clicked as a parameter you don't need to set all of those variables trying to get the player.
Your first 4 lines should look like this:
script.Parent.Touched:connect(function(player) phonez = player.PlayerGui.phone
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::] |
|
|
| Report Abuse |
|
|
|
| 23 May 2014 09:38 AM |
Whoops, like this:
script.Parent.MouseClicked:connect(function(player) phonez = player.PlayerGui.phone
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
|
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
|
| 23 May 2014 09:43 AM |
| Is the script suppose to be in script detector? If do then it says MouseClicked is not a valid member of click detector. |
|
|
| Report Abuse |
|
|
|
| 23 May 2014 09:44 AM |
Oops, it should be MouseClick, not MouseClicked.
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::] |
|
|
| Report Abuse |
|
|
Seeumliam
|
  |
| Joined: 06 May 2013 |
| Total Posts: 5662 |
|
| |
|