forked from tp-link-extender/2013
-
Notifications
You must be signed in to change notification settings - Fork 0
/
38037265.xml
392 lines (368 loc) · 11.6 KB
/
38037265.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<External>null</External>
<External>nil</External>
<Item class="Script" referent="RBX0">
<Properties>
<bool name="Disabled">false</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">Health</string>
<ProtectedString name="Source">function waitForChild(parent, childName)
local child = parent:findFirstChild(childName)
if child then return child end
while true do
child = parent.ChildAdded:wait()
if child.Name==childName then return child end
end
end
-- declarations
local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
local regening = false
-- regeneration
function regenHealth()
if regening then return end
regening = true
while Humanoid.Health < Humanoid.MaxHealth do
local s = wait(1)
local health = Humanoid.Health
if health > 0 and health < Humanoid.MaxHealth then
local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
health = health + newHealthDelta
Humanoid.Health = math.min(health,Humanoid.MaxHealth)
end
end
if Humanoid.Health > Humanoid.MaxHealth then
Humanoid.Health = Humanoid.MaxHealth
end
regening = false
end
Humanoid.HealthChanged:connect(regenHealth)
</ProtectedString>
<bool name="archivable">true</bool>
</Properties>
</Item>
<Item class="Script" referent="RBX1">
<Properties>
<bool name="Disabled">false</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">HealthScript v3.1</string>
<ProtectedString name="Source">local HealthGUI_prototype = script:FindFirstChild("HealthGUI")
local lastHealth = 100
local lastHealth2 = 100
local maxWidth = 0.96
local humanoid = script.Parent.Humanoid
if (humanoid == nil) then
print("ERROR: no humanoid found in 'HealthScript v3.1'")
end
function CreateGUI()
local p = game.Players:GetPlayerFromCharacter(humanoid.Parent)
HealthGUI_prototype.Parent = p.PlayerGui
end
function UpdateGUI(health)
tray = HealthGUI_prototype.tray
local width = (health / humanoid.MaxHealth) * maxWidth
local height = 0.83
local lastX = tray.bar.Position.X.Scale
local x = 0.019 + (maxWidth - width)
local y = 0.1
tray.bar.Position = UDim2.new(x ,0, y, 0)
tray.bar.Size = UDim2.new(width, 0, height, 0)
-- If more than 1/4 health, bar = green.Else, bar = red.
if( (health / humanoid.MaxHealth) > 0.25 ) then
tray.barRed.Size = UDim2.new(0, 0, 0, 0)
else
tray.barRed.Position = tray.bar.Position
tray.barRed.Size = tray.bar.Size
tray.bar.Size = UDim2.new(0, 0, 0, 0)
end
if ( (lastHealth - health) > (humanoid.MaxHealth / 10) ) then
lastHealth = health
if humanoid.Health ~= humanoid.MaxHealth then
delay(0,function()
AnimateHurtOverlay()
end)
delay(0,function()
AnimateBars(x, y, lastX, height)
end)
end
else
lastHealth = health
end
end
function HealthChanged(health)
UpdateGUI(health)
if ( (lastHealth2 - health) > (humanoid.MaxHealth / 10) ) then
lastHealth2 = health
else
lastHealth2 = health
end
end
function AnimateBars(x, y, lastX, height)
tray = HealthGUI_prototype.tray
local width = math.abs(x - lastX)
if( x > lastX ) then
x = lastX
end
tray.bar2.Position = UDim2.new(x,0, y, 0)
tray.bar2.Size = UDim2.new(width, 0, height, 0)
tray.bar2.BackgroundTransparency = 0
local GBchannels = 1
local j = 0.2
local i_total = 30
for i=1,i_total do
-- Increment Values
if (GBchannels < 0.2) then
j = -j
end
GBchannels = GBchannels + j
if (i > (i_total - 10)) then
tray.bar2.BackgroundTransparency = tray.bar2.BackgroundTransparency + 0.1
end
tray.bar2.BackgroundColor3 = Color3.new(1, GBchannels, GBchannels)
wait()
end
end
function AnimateHurtOverlay()
-- Start:
-- overlay.Position = UDim2.new(0, 0, 0, -22)
-- overlay.Size = UDim2.new(1, 0, 1.15, 30)
-- Finish:
-- overlay.Position = UDim2.new(-2, 0, -2, -22)
-- overlay.Size = UDim2.new(4.5, 0, 4.65, 30)
overlay = HealthGUI_prototype.hurtOverlay
overlay.Position = UDim2.new(-2, 0, -2, -22)
overlay.Size = UDim2.new(4.5, 0, 4.65, 30)
-- Animate In, fast
local i_total = 2
local wiggle_total = 0
local wiggle_i = 0.02
for i=1,i_total do
overlay.Position = UDim2.new( (-2 + (2 * (i/i_total)) + wiggle_total/2), 0, (-2 + (2 * (i/i_total)) + wiggle_total/2), -22 )
overlay.Size = UDim2.new( (4.5 - (3.5 * (i/i_total)) + wiggle_total), 0, (4.65 - (3.5 * (i/i_total)) + wiggle_total), 30 )
wait()
end
i_total = 30
wait()
-- Animate Out, slow
for i=1,i_total do
if( math.abs(wiggle_total) > (wiggle_i * 3) ) then
wiggle_i = -wiggle_i
end
wiggle_total = wiggle_total + wiggle_i
overlay.Position = UDim2.new( (0 - (2 * (i/i_total)) + wiggle_total/2), 0, (0 - (2 * (i/i_total)) + wiggle_total/2), -22 )
overlay.Size = UDim2.new( (1 + (3.5 * (i/i_total)) + wiggle_total), 0, (1.15 + (3.5 * (i/i_total)) + wiggle_total), 30 )
wait()
end
-- Hide after we're done
overlay.Position = UDim2.new(10, 0, 0, 0)
end
CreateGUI()
humanoid.HealthChanged:connect(HealthChanged)
humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<bool name="archivable">true</bool>
</Properties>
<Item class="GuiMain" referent="RBX2">
<Properties>
<string name="Name">HealthGUI</string>
<bool name="archivable">true</bool>
</Properties>
<Item class="ImageLabel" referent="RBX3">
<Properties>
<bool name="Active">false</bool>
<Color3 name="BackgroundColor3">4290164919</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool>
<Content name="Image"><url>http://mercury2.com/asset?id=34854607</url></Content>
<string name="Name">hurtOverlay</string>
<UDim2 name="Position">
<XS>2</XS>
<XO>0</XO>
<YS>0</YS>
<YO>-22</YO>
</UDim2>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>1.1500001</YS>
<YO>30</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
<bool name="archivable">true</bool>
</Properties>
</Item>
<Item class="Frame" referent="RBX4">
<Properties>
<bool name="Active">false</bool>
<Color3 name="BackgroundColor3">4285215356</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool>
<string name="Name">tray</string>
<UDim2 name="Position">
<XS>0.5</XS>
<XO>-44</XO>
<YS>1</YS>
<YO>-26</YO>
</UDim2>
<UDim2 name="Size">
<XS>0</XS>
<XO>170</XO>
<YS>0</YS>
<YO>18</YO>
</UDim2>
<token name="SizeConstraint">2</token>
<token name="Style">0</token>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
<bool name="archivable">true</bool>
</Properties>
<Item class="ImageLabel" referent="RBX5">
<Properties>
<bool name="Active">false</bool>
<Color3 name="BackgroundColor3">4294967295</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool>
<Content name="Image"><url>http://mercury2.com/asset?id=35238000</url></Content>
<string name="Name">bkg</string>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
<bool name="archivable">true</bool>
</Properties>
</Item>
<Item class="ImageLabel" referent="RBX6">
<Properties>
<bool name="Active">false</bool>
<Color3 name="BackgroundColor3">4294967295</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool>
<Content name="Image"><url>http://mercury2.com/asset?id=35238036</url></Content>
<string name="Name">barRed</string>
<UDim2 name="Position">
<XS>0.0189999994</XS>
<XO>0</XO>
<YS>0.100000001</YS>
<YO>0</YO>
</UDim2>
<UDim2 name="Size">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
<bool name="archivable">true</bool>
</Properties>
</Item>
<Item class="Frame" referent="RBX7">
<Properties>
<bool name="Active">false</bool>
<Color3 name="BackgroundColor3">4294967295</Color3>
<float name="BackgroundTransparency">1.00000012</float>
<Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">0</int>
<bool name="Draggable">false</bool>
<string name="Name">bar2</string>
<UDim2 name="Position">
<XS>0.0189999994</XS>
<XO>0</XO>
<YS>0.100000001</YS>
<YO>0</YO>
</UDim2>
<UDim2 name="Size">
<XS>0.192000002</XS>
<XO>0</XO>
<YS>0.829999983</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<token name="Style">0</token>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
<bool name="archivable">true</bool>
</Properties>
</Item>
<Item class="ImageLabel" referent="RBX8">
<Properties>
<bool name="Active">false</bool>
<Color3 name="BackgroundColor3">4294967295</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool>
<Content name="Image"><url>http://mercury2.com/asset?id=35238053</url></Content>
<string name="Name">bar</string>
<UDim2 name="Position">
<XS>0.0189999994</XS>
<XO>0</XO>
<YS>0.100000001</YS>
<YO>0</YO>
</UDim2>
<UDim2 name="Size">
<XS>0.959999979</XS>
<XO>0</XO>
<YS>0.829999983</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
<bool name="archivable">true</bool>
</Properties>
</Item>
<Item class="ImageLabel" referent="RBX9">
<Properties>
<bool name="Active">false</bool>
<Color3 name="BackgroundColor3">4294967295</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">0</int>
<bool name="Draggable">false</bool>
<Content name="Image"><url>http://mercury2.com/asset?id=34816363</url></Content>
<string name="Name">label</string>
<UDim2 name="Position">
<XS>0.680000007</XS>
<XO>0</XO>
<YS>0.300000012</YS>
<YO>0</YO>
</UDim2>
<UDim2 name="Size">
<XS>0.25</XS>
<XO>0</XO>
<YS>0.349999994</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<bool name="Visible">true</bool>
<int name="ZIndex">1</int>
<bool name="archivable">true</bool>
</Properties>
</Item>
</Item>
</Item>
</Item>
</roblox>