Clients/Client2016/content/fonts/humanoidExtra.rbxm

11 lines
2.6 KiB
Plaintext

<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">
<Properties>
<bool name="Disabled">false</bool>
<string name="Name">Script</string>
<string name="Source">&#13;&#10;while script.Parent.Head==nil do&#13;&#10;&#9;wait(0.05)&#13;&#10;end&#13;&#10;&#13;&#10;function newSound(id)&#13;&#10;&#9;local sound = Instance.new(&quot;Sound&quot;)&#13;&#10;&#9;sound.SoundId = id&#13;&#10;&#9;sound.Parent = script.Parent.Head&#13;&#10;&#9;return sound&#13;&#10;end&#13;&#10;&#13;&#10;sDied = newSound(&quot;rbxasset://sounds/uuhhh.wav&quot;)&#13;&#10;sFallingDown = newSound(&quot;rbxasset://sounds/splat.wav&quot;)&#13;&#10;sFreeFalling = newSound(&quot;rbxasset://sounds/swoosh.wav&quot;)&#13;&#10;sGettingUp = newSound(&quot;rbxasset://sounds/hit.wav&quot;)&#13;&#10;sJumping = newSound(&quot;rbxasset://sounds/button.wav&quot;)&#13;&#10;sRunning = newSound(&quot;rbxasset://sounds/bfsl-minifigfoots1.mp3&quot;)&#13;&#10;sRunning.Looped = true&#13;&#10;&#13;&#10;function onDied()&#13;&#10;&#9;sDied:play()&#13;&#10;end&#13;&#10;&#13;&#10;function onState(state, sound)&#13;&#10;&#9;if state then&#13;&#10;&#9;&#9;sound:play()&#13;&#10;&#9;else&#13;&#10;&#9;&#9;sound:pause()&#13;&#10;&#9;end&#13;&#10;end&#13;&#10;&#13;&#10;function onRunning(speed)&#13;&#10;&#9;if speed&gt;0 then&#13;&#10;&#9;&#9;sRunning:play()&#13;&#10;&#9;else&#13;&#10;&#9;&#9;sRunning:pause()&#13;&#10;&#9;end&#13;&#10;end&#13;&#10;&#13;&#10;while script.Parent.Humanoid==nil do&#13;&#10;&#9;wait(0.05)&#13;&#10;end&#13;&#10;&#13;&#10;h = script.Parent.Humanoid&#13;&#10;h.Died:connect(onDied)&#13;&#10;h.Running:connect(onRunning)&#13;&#10;h.Jumping:connect(function(state) onState(state, sJumping) end)&#13;&#10;h.GettingUp:connect(function(state) onState(state, sGettingUp) end)&#13;&#10;h.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)&#13;&#10;h.FallingDown:connect(function(state) onState(state, sFallingDown) end)&#13;&#10;&#13;&#10;-- regeneration&#13;&#10;while true do&#13;&#10;&#9;local s = wait(1)&#13;&#10;&#9;local health=h.Health&#13;&#10;&#9;if health&gt;0 and health&lt;h.MaxHealth then&#13;&#10;&#9;&#9;health = health + 0.01*s*h.MaxHealth&#13;&#10;&#9;&#9;if health*1.05 &lt; h.MaxHealth then&#13;&#10;&#9;&#9;&#9;h.Health = health&#13;&#10;&#9;&#9;else&#13;&#10;&#9;&#9;&#9;h.Health = h.MaxHealth&#13;&#10;&#9;&#9;end&#13;&#10;&#9;end&#13;&#10;end&#13;&#10;</string>
</Properties>
</Item>
</roblox>