This is a mod of a script posted by Guga Bernardo a while back. It works for those who have the Giga Vienna Perf. Library, but would like non-password protected Legato Script. I imported my Giga files into EXS and Kontakt2. I had to reorganize a bit my keygroups, K2/EXS would not import the groups correctly but not assign them to triggered by a key. I know this is complicated stuff, but I hope it helps.

on init

{ Used variables }

declare $time
declare $last_note
declare $interval
declare $leg_interval
declare $active_id
declare $note_count
declare $enable_legato
declare $ghost
declare $repetition

{ User Interface }

declare ui_button $VSL_GroupKeys
declare ui_value_edit $FirstLeg (0,127,1) { First Legato Keyswitch (1 semitone) }
declare ui_value_edit $NoLegKey (0,127,1) { Keyswitch for starting note }
declare ui_value_edit $RlsKey (0,127,1) { Keyswitch for released note }
declare ui_value_edit $RepKey (0,127,1) { Keyswtich for repeated/legato note }
declare ui_value_edit $RepThrs (0,5000,1) { Threshold (ms) for repeated note }
declare ui_value_edit $GhostKey (0,127,1) { Ghostkey - any key not in the playzone for
triggering a ghost note for legato }
declare ui_button $PlayZone
declare ui_value_edit $From (0,127,1) { First note of the lower octave playzone }
declare ui_value_edit $To (0,127,1) { Last note of the lower octave playzone }
declare ui_button $LegatoParam
declare ui_value_edit $Threshld (0,1000,1) { Threshold (ms) for unconnected legato }
declare ui_value_edit $Release (0,1000,1) { Release time (ms) }
declare ui_value_edit $Transp (-36,36,1) { Transpose Chromatically}
declare ui_button $TranspButton

move_control ($GhostKey,2,2)
move_control ($PlayZone,1,3)
move_control ($From,2,3)
move_control ($To,3,3)
move_control ($LegatoParam,4,3)
move_control ($Threshld,5,3)
move_control ($Release,6,3)
move_control ($Transp,4,2)
move_control ($TranspButton,3,2)

{ Fill UI with default values }

$From := 31 { G1 }
$To := 74 { D5 }
$GhostKey := 24 { C1 }
$RlsKey := 14 { D0 }
$RepKey := 13 { C#0 }
$RepThrs := 500
$NoLegKey := 15 { D#0 }
$FirstLeg := 1 { C#-1 }
$Transp := 24 { C#-1 }

{ Save UI values with patch }

make_persistent ($Threshld)
make_persistent ($Release)
make_persistent ($From)
make_persistent ($To)
make_persistent ($GhostKey)
make_persistent ($RlsKey)
make_persistent ($RepKey)
make_persistent ($RepThrs)
make_persistent ($NoLegKey)
make_persistent ($FirstLeg)
make_persistent ($Transp)

{ initialize variables }

$interval := 0
$time := 0
$note_count := 0
$ghost := 0
$repetition := 0

message(" ")
end on

on note
change_note ($EVENT_ID,$EVENT_NOTE + $Transp)
if ($EVENT_NOTE = $RlsKey)
exit
end if

ignore_event($EVENT_ID)

if ($EVENT_NOTE = $GhostKey)
$ghost := 1
exit
end if

if (not in_range($EVENT_NOTE,$From,$To))
exit
end if

$enable_legato := 1
if (($note_count = 0) and ($ghost = 0))
if ($time # 0)
if ($ENGINE_UPTIME - $time > $Threshld)
$enable_legato := 0
end if
else
$enable_legato := 0
end if
end if

if ($enable_legato = 1)
if ($last_note # 0)
$interval := $EVENT_NOTE - $last_note
end if
else
$interval := 0
end if

$leg_interval := abs($interval)
if ($leg_interval > 12)
$leg_interval := 12
end if

if ($leg_interval # 0)
play_note($leg_interval+$FirstLeg-1,100,0,1)
$note_count := $note_count + 1
else
if (($last_note = $EVENT_NOTE) and ($repetition = 0) and ($ENGINE_UPTIME - $time <= $RepThrs))
play_note($RepKey,100,0,1)
$repetition := 1
else
play_note($NoLegKey,100,0,1)
$repetition := 0
end if
$note_count := $note_count + 1
end if

if ($ghost # 1)
note_off ($active_id)
if ($interval >= 0)
$active_id := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1)
$note_count := $note_count + 1
else
$active_id := play_note($EVENT_NOTE+48,$EVENT_VELOCITY,0,-1)
$note_count := $note_count + 1
end if
$ghost := 0
else
$ghost := 2
end if

$last_note := $EVENT_NOTE
$note_count := $note_count + 1
end on

on release
if ($Release # 0)
ignore_event ($EVENT_ID)
wait ($Release*500)
note_off ($EVENT_ID)
end if
dec($note_count)
if ($note_count < 0)
$note_count := 0
end if
$time := $ENGINE_UPTIME
end on

on ui_control ($PlayZone)
$PlayZone := 0
end on
on ui_control ($VSL_GroupKeys)
$VSL_GroupKeys := 0
end on
on ui_control ($LegatoParam)
$LegatoParam := 0
end on