|
| 26 Jul 2015 05:33 PM |
Heres the tree of whats going on...
L* = LocalScript Game - StarterGui - KeyPressScript(L*) - Operate (BOOLVAL) - [Value = true]
Contents of KeyPressScript: ---------------------------------------------------------------------------------------------- local plr=game.Players.LocalPlayer local mouse=plr:GetMouse() state = script.Value.Value Operate = script.Operate.Value
function keyDown(key) if Operate == true then
------------------------------------------------------- a, Refer to summary-------------------
if key == "q" then -- ASSIGNED KEY if state == true then script.Parent.Menu.MainMenu:TweenPosition(UDim2.new(3,0,0.2,0),"Out","Quad",2,true,nil) state = false else script.Parent.Menu.MainMenu:TweenPosition(UDim2.new(0.15,0,0.2,0),"Out","Quad",2,true,nil) state = true ------------------------------------------------------- a, Refer to summary ------------------- end end end end mouse.KeyDown:connect(keyDown)
_________________________________________________________________________________________________________ There is "another" script that attempts to create the "Operate" Value false.
local Button = script.Parent
local Operation = script.Parent.Parent.Parent.Parent.Parent.Parent.KeyPressScript.Operate.Value ------------------------ "(Operate = script.Operate.Value)" -------------------
function onClick() Operation = false ----------------------------------------------------This makes the Value False Here. end
Button.MouseButton1Click:connect(onClick)
_______________________________________________________________________ Summary of problem.
When the Operate Value is turned false, in the contents of KeyPressScript part 'a' is still operating when it shouldn't be.
When giving feedback/answers. Please be constructive and explain why to do this and that. Avoid needing to alter a lot of things, or deleting a lot of things. Avoid Drama.
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Jul 2015 05:38 PM |
'Operate = script.Operate.Value' You're setting that variable to the current value of the BoolValue. There are no 'pointers' in Lua. So what you want to do is this:
'Operator = script.Operate' And where ever you change the value, do 'Operater.Value = blah' instead of 'Operater = blah'
Also, you're not a mod. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 05:42 PM |
@above
Problem still persists, I think that your comment didn't help, it seems that "RandomBooleanValue.Value" is required. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Jul 2015 05:43 PM |
No, you just didn't do it for the other script: 'local Operation = script.Parent.Parent.Parent.Parent.Parent.Parent.KeyPressScript.Operate.Value' That part is also wrong, read my first post. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 05:49 PM |
Ok, heres the update.
Heres the tree of whats going on...
L* = LocalScript Game - StarterGui - KeyPressScript(L*) - Operate (BOOLVAL) - [Value = true]
Contents of KeyPressScript: ---------------------------------------------------------------------------------------------- local plr=game.Players.LocalPlayer local mouse=plr:GetMouse() Operate = script.Operate -------------------- UPDATED
function keyDown(key) if Operate == true then
------------------------------------------------------- a, Refer to summary-------------------
if key == "q" then -- ASSIGNED KEY if state == true then script.Parent.Menu.MainMenu:TweenPosition(UDim2.new(3,0,0.2,0),"Out","Quad",2,true,nil) state = false else script.Parent.Menu.MainMenu:TweenPosition(UDim2.new(0.15,0,0.2,0),"Out","Quad",2,true,nil) state = true ------------------------------------------------------- a, Refer to summary ------------------- end end end end mouse.KeyDown:connect(keyDown)
_________________________________________________________________________________________________________ There is "another" script that attempts to create the "Operate" Value false.
local Button = script.Parent
local Operation = script.Parent.Parent.Parent.Parent.Parent.Parent.KeyPressScript.Operate --------- UPDATED ------------------------ "(Operate = script.Operate.Value)" -------------------
function onClick() Operation = false ----------------------------------------------------This makes the Value False Here. end
Button.MouseButton1Click:connect(onClick)
_______________________________________________________________________ Summary of persisting problem.
When the Operate Value is turned false, in the contents of KeyPressScript part 'a' is still operating when it shouldn't be. Refer to the capitalised 'UPDATED' for changes.
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Jul 2015 05:51 PM |
I already answered this. "And where ever you change the value, do 'Operater.Value = blah' instead of 'Operater = blah"
That goes for the Operation one too. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 05:52 PM |
Further problems,
When Q is pressed, "a" (refer to first script) is not working. however, If i do not remove the ".value" Q is pressed and "a" operating.
|
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 05:54 PM |
OHHHH I GET IT....
Sorry. Lol. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 05:57 PM |
Wait, So I've done this now...
local Button = script.Parent local Operation = script.Parent.Parent.Parent.Parent.Parent.Parent.KeyPressScript.Operate --------------------------------Declarations function onClick() script.Parent.Parent.Parent.Parent:TweenPosition(UDim2.new(3,0,0.2,0),"Out","Quad",2,true,nil) script.Parent.Parent.Parent.Parent.Parent.MainMenuI:TweenPosition(UDim2.new(0.15,0,0.2,0),"Out","Quad",2,true,nil) Operation.Value = false end
Button.MouseButton1Click:connect(onClick) .......
Neither is the tween effect working (for a particular frame i created) And I checked the BoolValue to see if its changed, Boolvalue has not changed according to robloxstudioexplorer. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 06:05 PM |
All problems are fixed. o.o thnx for the help.
ik im not a dev ^-^ |
|
|
| Report Abuse |
|
|