@@ -107,8 +107,9 @@ function PART:GetOrFindCachedPart(uid_or_name)
107107 self .erroring_cached_parts = {}
108108 self .found_cached_parts = self .found_cached_parts or {}
109109 if self .found_cached_parts [uid_or_name ] then self .erroring_cached_parts [uid_or_name ] = nil return self .found_cached_parts [uid_or_name ] end
110- if self .erroring_cached_parts [uid_or_name ] then return end
111- if self .bad_uid_search and self .bad_uid_search > 250 then return end
110+ if self .bad_uid_search and self .bad_uid_search > 250 then
111+ return
112+ end
112113
113114 local owner = self :GetPlayerOwner ()
114115 part = pac .GetPartFromUniqueID (pac .Hash (owner ), uid_or_name ) or pac .FindPartByPartialUniqueID (pac .Hash (owner ), uid_or_name )
@@ -122,10 +123,11 @@ function PART:GetOrFindCachedPart(uid_or_name)
122123 self .erroring_cached_parts [uid_or_name ] = true
123124 self .bad_uid_search = self .bad_uid_search or 0
124125 self .bad_uid_search = self .bad_uid_search + 1
125- if self :GetPlayerOwner () == LocalPlayer () and not pace .still_loading_wearing then
126+ if self :GetPlayerOwner () == LocalPlayer () and not pace .still_loading_wearing and self . bad_uid_search > 2 then
126127 pace .FlashNotification (" performance warning! " .. tostring (self ) .. " keeps searching for parts not finding anything! " .. tostring (uid_or_name ) .. " may be unused!" )
127128 end
128129 else
130+ self .bad_uid_search = nil
129131 self .found_cached_parts [uid_or_name ] = part
130132 return part
131133 end
@@ -457,7 +459,7 @@ PART.Inputs.sample_and_hold = function(self, seed, duration, min, max, ease)
457459 self .samplehold = self .samplehold or {}
458460 self .samplehold_prev = self .samplehold_prev or {}
459461 self .samplehold_duration = self .samplehold_duration or {}
460- self .samplehold_prev [seed ] = self .samplehold_prev [seed ] or {value = min , refresh = CurTime ()}
462+ self .samplehold_prev [seed ] = self .samplehold_prev [seed ] or {value = min + math.random () * ( max - min ) , refresh = CurTime ()}
461463 self .samplehold [seed ] = self .samplehold [seed ] or {value = min + math.random ()* (max - min ), refresh = CurTime () + duration }
462464
463465 self .samplehold_duration [seed ] = self .samplehold_duration [seed ] or CurTime ()
@@ -745,6 +747,7 @@ PART.Inputs.ezfade = function(self, speed, starttime, endtime)
745747 starttime = starttime or 0
746748 self .time = self .time or pac .RealTime
747749 local timeex = pac .RealTime - self .time
750+ if self .timeex_override then timeex = self .timeex_override end
748751 local start_offset_constant = - starttime * speed
749752 local result = 0
750753
@@ -777,6 +780,7 @@ PART.Inputs.ezfade_4pt = function(self, in_starttime, in_endtime, out_starttime,
777780
778781 self .time = self .time or pac .RealTime
779782 local timeex = pac .RealTime - self .time
783+ if self .timeex_override then timeex = self .timeex_override end
780784
781785 if in_starttime == in_endtime then
782786 if timeex < in_starttime then
@@ -1143,6 +1147,7 @@ PART.Inputs.pose_parameter_true = function(self, name)
11431147 local owner = get_owner (self )
11441148 if owner :IsValid () then
11451149 local min , max = owner :GetPoseParameterRange (owner :LookupPoseParameter (name ))
1150+ if not min or not max then return 0 end
11461151 return min + (max - min )* (owner :GetPoseParameter (name ))
11471152 end
11481153 return 0
@@ -1467,6 +1472,32 @@ do
14671472 end
14681473end
14691474
1475+ PART .Inputs .dot_forward = function (self )
1476+ local part = get_owner (self )
1477+
1478+ if part :IsValid () then
1479+ local ang = part :IsPlayer () and part :EyeAngles () or part :GetAngles ()
1480+ local dir = pac .EyePos - part :EyePos ()
1481+ dir :Normalize ()
1482+ return dir :Dot (ang :Forward ())
1483+ end
1484+
1485+ return 0
1486+ end
1487+
1488+ PART .Inputs .dot_right = function (self )
1489+ local part = get_owner (self )
1490+
1491+ if part :IsValid () then
1492+ local ang = part :IsPlayer () and part :EyeAngles () or part :GetAngles ()
1493+ local dir = pac .EyePos - part :EyePos ()
1494+ dir :Normalize ()
1495+ return dir :Dot (ang :Right ())
1496+ end
1497+
1498+ return 0
1499+ end
1500+
14701501PART .Inputs .flat_dot_forward = function (self )
14711502 local part = get_owner (self )
14721503
@@ -1687,31 +1718,43 @@ function PART:SetExpression(str, slot)
16871718end
16881719
16891720function PART :SetExpressionOnHide (str )
1721+ if not self .errors_override then self :SetWarning () else timer .Simple (10 , function () self :SetWarning () end ) end
1722+ self .error = false
16901723 self .ExpressionOnHide = str
16911724 self :SetExpression (str , 0 )
16921725end
16931726
16941727function PART :SetExtra1 (str )
1728+ if not self .errors_override then self :SetWarning () else timer .Simple (10 , function () self :SetWarning () end ) end
1729+ self .error = false
16951730 self .Extra1 = str
16961731 self :SetExpression (str , 1 )
16971732end
16981733
16991734function PART :SetExtra2 (str )
1735+ if not self .errors_override then self :SetWarning () else timer .Simple (10 , function () self :SetWarning () end ) end
1736+ self .error = false
17001737 self .Extra2 = str
17011738 self :SetExpression (str , 2 )
17021739end
17031740
17041741function PART :SetExtra3 (str )
1742+ if not self .errors_override then self :SetWarning () else timer .Simple (10 , function () self :SetWarning () end ) end
1743+ self .error = false
17051744 self .Extra3 = str
17061745 self :SetExpression (str , 3 )
17071746end
17081747
17091748function PART :SetExtra4 (str )
1749+ if not self .errors_override then self :SetWarning () else timer .Simple (10 , function () self :SetWarning () end ) end
1750+ self .error = false
17101751 self .Extra4 = str
17111752 self :SetExpression (str , 4 )
17121753end
17131754
17141755function PART :SetExtra5 (str )
1756+ if not self .errors_override then self :SetWarning () else timer .Simple (10 , function () self :SetWarning () end ) end
1757+ self .error = false
17151758 self .Extra5 = str
17161759 self :SetExpression (str , 5 )
17171760end
@@ -2182,6 +2225,12 @@ function PART:GetActiveFunctions()
21822225 table.insert (possible_funcs , kw )
21832226 end
21842227 end
2228+ for kw ,_ in pairs (PART .Functions ) do
2229+ local kw2 = kw .. " ("
2230+ if string.find (self .Expression , kw2 , 0 , true ) ~= nil then
2231+ table.insert (possible_funcs , kw )
2232+ end
2233+ end
21852234
21862235 return possible_funcs
21872236end
0 commit comments