generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: New wiring/logic gates (need testing and code fixes)

Previous Thread :: Next Thread 
Austin5003 is not online. Austin5003
Joined: 13 Sep 2009
Total Posts: 22
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 is not online. NotAshley
Joined: 16 Jan 2014
Total Posts: 14257
27 Apr 2015 10:34 PM
could you post the code here?
Report Abuse
Austin5003 is not online. Austin5003
Joined: 13 Sep 2009
Total Posts: 22
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
Austin5003 is not online. Austin5003
Joined: 13 Sep 2009
Total Posts: 22
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
Austin5003 is not online. Austin5003
Joined: 13 Sep 2009
Total Posts: 22
17 Jul 2015 12:30 AM
And now you're probably gonna steal these, aren't you?
Report Abuse
TimeTicks is not online. 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
Austin5003 is not online. Austin5003
Joined: 13 Sep 2009
Total Posts: 22
14 Aug 2015 03:04 PM
Posting the code was probably my biggest mistake ever.
Report Abuse
Skyman772 is not online. Skyman772
Joined: 20 Mar 2012
Total Posts: 9305
14 Aug 2015 03:22 PM
that's gross
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
14 Aug 2015 03:22 PM
No one wants your code bud.


Check out my in-game scripting tutorial! [ 279086510 ]
Report Abuse
booing is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image