Content deleted Content added
No edit summary |
AvorionGamer (talk | contribs) Replace example of code |
||
Line 21: | Line 21: | ||
====Example==== |
====Example==== |
||
<syntaxhighlight lang="lua" line="1"> |
<syntaxhighlight lang="lua" line="1"> |
||
local servo = GetPartFromPort(1, |
local servo = GetPartFromPort(1,"Servo") |
||
local switch = GetPartFromPort(2,"Switch") |
|||
switch:Configure({SwitchValue=false}) |
|||
servo:SetAngle(15) -- Set the angle of servo's hinge. |
|||
servo:SetAngle(math.random(1,360)) |
|||
wait(2) |
|||
switch:Configure({SwitchValue=true}) |
|||
</syntaxhighlight> |
</syntaxhighlight> |