Selantox
|
  |
| Joined: 01 Dec 2011 |
| Total Posts: 388 |
|
|
| 02 Aug 2016 08:42 PM |
Hey, it's me again ^^' Got another problem with my blinkers. On my last thread I was asking someone to make me a blinker script for my car as I'm new to scripting. Woolhat's script is working very well, but I've got another problem. Before I explain it here are the scripts :
local Blinking = false
function onKeyPress(actionName, userInputState, inputObject) if userInputState == Enum.UserInputState.Begin then Blinking = not Blinking while Blinking do script.Parent.Turn1:play() wait(0.1) script.Parent.RightIndicator.Material = "Neon" script.Parent.RightIndicator2.Material = "Neon" wait(0.5) script.Parent.Turn2:play() wait(0.1) script.Parent.RightIndicator.Material = "SmoothPlastic" script.Parent.RightIndicator2.Material = "SmoothPlastic" wait(0.5) end end end
game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.C)
And the left one :
local Blinking = false
function onKeyPress(actionName, userInputState, inputObject) if userInputState == Enum.UserInputState.Begin then Blinking = not Blinking while Blinking do script.Parent.Turn1:play() wait(0.1) script.Parent.LeftIndicator.Material = "Neon" script.Parent.LeftIndicator2.Material = "Neon" wait(0.5) script.Parent.Turn2:play() wait(0.1) script.Parent.LeftIndicator.Material = "SmoothPlastic" script.Parent.LeftIndicator2.Material = "SmoothPlastic" wait(0.5) end end end
game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.Z)
Alright, so when I create 2 scripts file and paste in the first one the right signal script and in the second one the left signal script, only one script activates.
I thinked of putting the two scripts together in one script file so there wouldn't be any conflicts (I guess) but I can't figure out how to do that without avoiding the problem.
So if one of you guys know how to do that please reply below
Thank you |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2016 08:52 PM |
| Which one is the one that activates? |
|
|
| Report Abuse |
|
|
Selantox
|
  |
| Joined: 01 Dec 2011 |
| Total Posts: 388 |
|
|
| 02 Aug 2016 09:01 PM |
| The left script activates when the scripts are either separated or in the same file |
|
|
| Report Abuse |
|
|
Selantox
|
  |
| Joined: 01 Dec 2011 |
| Total Posts: 388 |
|
|
| 02 Aug 2016 09:02 PM |
| Wait nevermind it depends on which key you press when first entering test mode in Studio |
|
|
| Report Abuse |
|
|
Selantox
|
  |
| Joined: 01 Dec 2011 |
| Total Posts: 388 |
|
| |
|
Selantox
|
  |
| Joined: 01 Dec 2011 |
| Total Posts: 388 |
|
| |
|
sentry3
|
  |
| Joined: 01 May 2010 |
| Total Posts: 538 |
|
| |
|
Selantox
|
  |
| Joined: 01 Dec 2011 |
| Total Posts: 388 |
|
|
| 03 Aug 2016 01:04 PM |
Idk, I got the script like that
|
|
|
| Report Abuse |
|
|
Selantox
|
  |
| Joined: 01 Dec 2011 |
| Total Posts: 388 |
|
| |
|
Selantox
|
  |
| Joined: 01 Dec 2011 |
| Total Posts: 388 |
|
| |
|