|
| 16 Feb 2016 10:44 PM |
| I have 2 camera scripts and i am trying to find out a way to switch between the 2 camera modes using one GUI. I have tried so many methods but i just can't figure it out. Thanks for any help. |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2016 10:45 PM |
Post an example of what your trying to accomplish........................
|
|
|
| Report Abuse |
|
|
|
| 16 Feb 2016 10:47 PM |
| Like a script? or a game example? |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Feb 2016 10:51 PM |
I have a bool. value inside the text box that has a local script that is supposed to change the activated script when it's value is changed. here is the script for that:
script.Parent.Parent.MouseButton1Down:connect(function() if script.Parent.Value == true then script.Parent.Parent.LocalScript.Disabled = false else if script.Parent.Value == false then script.Parent.Parent.LocalScript.Disabled = true end end end)
I also have a local script inside a text box that monitors whether it is activated or not, here is the script for that:
local C = script.Parent.Parent.Parent.Parent.PlayerScripts.CameraScript script.Parent.MouseButton1Down:connect(function() C.Disabled = true script.Parent.Parent.Parent.Parent.PlayerScripts.CameraScript2.Disabled = false if script.Parent.Activated.Value == false then script.Parent.Activated.Value = true else script.Parent.Activated.Value = false end end) |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2016 10:54 PM |
Let me get my head around this:
You want it when they click a button it disables there camera script and when they click it again it re ables it?
|
|
|
| Report Abuse |
|
|
|
| 16 Feb 2016 10:57 PM |
| No, there are 2 camera scripts. whenever the player clicks the gui one of those scripts will get disabled and the other will be activated and vise versa. the problem i am running into is that once the camera script is activated it becomes inactive so if you disable it and enable it again, it will do nothing. i think i need to make a clone of each camera script when it is disabled and do something with that. |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Feb 2016 11:13 PM |
" there are 2 camera scripts"
The one in playerscripts and ..?
|
|
|
| Report Abuse |
|
|
|
| 16 Feb 2016 11:14 PM |
| The default camera script and another one that i made with some help. |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2016 11:16 PM |
Where is the one you made located? (name of it as well)
|
|
|
| Report Abuse |
|
|
|
| 16 Feb 2016 11:18 PM |
| I named it "CameraScript2" and it is disabled and located StarterScript>StarterPlayerScripts |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2016 11:23 PM |
Something like this? (local script)
local player = game.Players.LocalPlayer local camscript1 = player.PlayerScripts:WaitForChild("CameraScript") local camscript2 = player.PlayerScripts:WaitForChild("CameraScript2") local bool = false
button.MouseButton1Down:connect(function() if bool == false then bool = true camscript1.Disabled = true camscript2.Disabled = false else if bool == true then bool = false camscript1.Disabled = false camscript2.Disabled = true end end end)
|
|
|
| Report Abuse |
|
|
|
| 16 Feb 2016 11:27 PM |
| That WOULD work but the exception is that once one of the scripts gets enabled, it will run a script and be over. So, if u disable it and enable it again, it will not work any more. That is why i said i would prob have to make a disabled clone of it. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|