Anonymous user
→Programming
Tags: Mobile edit Mobile web edit |
|||
Line 21:
====Example====
<syntaxhighlight lang="lua" line="1">
local servo = GetPartFromPort(1,"Servo") --Main Variant.
local switch = GetPartFromPort(2,"Switch") --A switch must be connected to a servo and a PowerCell.
switch:Configure({SwitchValue=false})
servo:SetAngle(math.rad(math.random(1,360)))
wait(2)
switch:Configure({SwitchValue=true})
|