|
| 27 Apr 2015 10:23 PM |
I've tried to create some new logic circuits, but they just aren't successful (or just haven't been tested yet). Any info regarding where things went wrong/how to fix something is appreciated.
http://www.roblox.com/Variable-signal-capacitor-pulse-lengthener-item?id=242924724 http://www.roblox.com/Wiring-xor-gate-item?id=170919015 http://www.roblox.com/Wiring-SR-latch-item?id=185297689 |
|
|
| Report Abuse |
|
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
|
| 27 Apr 2015 10:34 PM |
| could you post the code here? |
|
|
| Report Abuse |
|
|
|
| 28 Apr 2015 10:03 AM |
[XOR gate] -- Made by Austin5003 --
sp=script.Parent
local inputs={sp.Input1:GetCurrentValue(),sp.Input2:GetCurrentValue()}
function check() if inputs[1]>.5 and sp.Parent:FindFirstChild("Light1Color") then sp.Parent.Light1Color.BrickColor=BrickColor.new("Dark green") else sp.Parent.Light1Color.BrickColor=BrickColor.new("Bright red") end if inputs[2]>.5 and sp.Parent:FindFirstChild("Light2Color") then sp.Parent.Light2Color.BrickColor=BrickColor.new("Dark green") else sp.Parent.Light2Color.BrickColor=BrickColor.new("Bright red") end if inputs[1]>.5 or inputs[2]>.5 then script.OR.Value:SetValue(true) else script.OR.Value:SetValue(false)
if inputs[1]>.5 and inputs[2]>.5 then script.AND.Value:SetValue(true) else script.And.Value:SetValue(false) end if script.OR.Value == true and script.AND.Value == false then sp.Output:SetValue(1) else sp.Output:SetValue(0) end end end if sp.Output.Value == 1 and sp.Parent:FindFirstChild("Light3Color") then sp.Parent.Light3Color.BrickColor=BrickColor.new("Dark green") else script.Parent.Light3Color.BrickColor=BrickColor.new("Bright red") end sp.Input1.SourceValueChanged:connect(function(val) inputs[1]=val check() end)
sp.Input2.SourceValueChanged:connect(function(val) inputs[2]=val check() end) check()
[Signal capacitor] --Made by Austin5003--
sp=script.Parent
function check(val) if sp.Parent:FindFirstChild("Light1Color") then if val > .5 then sp.Output:SetValue(1) sp.Parent.Light1Color.BrickColor=BrickColor.new("Dark green") else sp.Parent.Light1Color.BrickColor=BrickColor.new("Bright red") end end wait(sp.Configuration.Capacitance.Value) sp.Output:SetValue(0) if sp.Parent:FindFirstChild("Light2Color") then if val>.5 then sp.Parent.Light2Color.BrickColor=BrickColor.new("Dark green") else sp.Parent.Light2Color.BrickColor=BrickColor.new("Bright red") end end end
sp.CapacitorInput.SourceValueChanged:connect(check) check(sp.CapacitorInput:GetCurrentValue())
[SR latch] -- Made by Austin5003 --
sp=script.Parent
local inputs={sp.Set:GetCurrentValue(),sp.Reset:GetCurrentValue()}
function check() if inputs[1]>.5 and sp.Parent:FindFirstChild("Light1Color") then sp.Parent.Light1Color.BrickColor=BrickColor.new("Dark green") else sp.Parent.Light1Color.BrickColor=BrickColor.new("Bright red") end if inputs[2]>.5 and sp.Parent:FindFirstChild("Light2Color") then sp.Parent.Light2Color.BrickColor=BrickColor.new("Dark green") else sp.Parent.Light2Color.BrickColor=BrickColor.new("Bright red") end if inputs[1]>.5 then sp.Output:SetValue(1) if sp.Parent:FindFirstChild("Light3Color") then sp.Parent.Light3Color.BrickColor=BrickColor.new("Dark green") end if inputs[2]>.5 then sp.Output:setValue(0) if sp.Parent:FindFirstChild("Light3Color") then sp.Parent.Light3Color.BrickColor=BrickColor.new("Bright red") end --else condition removed to retain state-- end end
sp.Set.SourceValueChanged:connect(function(val) inputs[1]=val check() end)
sp.Reset.SourceValueChanged:connect(function(val) inputs[2]=val check() end)
check() end |
|
|
| Report Abuse |
|
|
|
| 28 Apr 2015 10:09 AM |
[Programmable logic array] s=script sp=s.Parent config=sp.Configuraton
local inputs={sp.Input1:GetCurrentValue(),sp.Input2:GetCurrentValue()}
function check() if inputs[1]>.5 and inputs[2]>.5 then s.norTrue.Value=1 else s.norTrue.Value=0 end if inputs[1]>.5 and inputs[2]<.5 then s.anotbTrue.Value=1 else s.anotbTrue.Value=0 end if inputs[1]<.5 and inputs[2]>.5 then s.bnotaTrue.Value=1 else s.bnotaTrue.Value=0
end if inputs[1]>.5 and inputs[2]>.5 then s.andTrue.Value=1 else s.andTrue.Value=0 end if s.norTrue.Value==1 and sp.config.NOR.Value==1 or s.anotbTrue.Value==1 and sp.configAnotB.Value==1 or s.bnotaTrue.Value==1 and sp.config.BnotA.Value==1 or s.andTrue.Value==1 and sp.config.AND.Value==1 then sp.Output:SetValue(1) if sp.Parent:FindFirstChild("Light1Color") then sp.Parent.Light1Color.BrickColor=BrickColor.new("Dark green") else sp.Output:SetValue(0) if sp.Parent:FindFirstChild("Light1Color") then sp.Parent.Light1Color.BrickColor=BrickColor.new("Bright red") end end
sp.Input1.SourceValueChanged:connect(function(val) inputs[1]=val check() end)
sp.Input2.SourceValueChanged:connect(function(val) inputs[2]=val check() end)
check()
|
|
|
| Report Abuse |
|
|
|
| 17 Jul 2015 12:30 AM |
| And now you're probably gonna steal these, aren't you? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Jul 2015 12:31 AM |
Good god. Kill me now.
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 03:04 PM |
| Posting the code was probably my biggest mistake ever. |
|
|
| Report Abuse |
|
|
Skyman772
|
  |
| Joined: 20 Mar 2012 |
| Total Posts: 9305 |
|
| |
|
|
| 14 Aug 2015 03:22 PM |
No one wants your code bud.
Check out my in-game scripting tutorial! [ 279086510 ] |
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 14 Aug 2015 03:23 PM |
| Um this is my code in my new game VAKCINE Base |
|
|
| Report Abuse |
|
|