2DWorlds Forums
I'm going to be making some tools for anyone to use. - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13)
+--- Thread: I'm going to be making some tools for anyone to use. (/showthread.php?tid=1818)



I'm going to be making some tools for anyone to use. - Duck - 04-03-2011

Here's my first one, a nice simple RBX.Lua translation (Although I modified it a bit)

It's basically a Bandaid.

It should be Holdable and I made a texture (although you can make your own obviously :P
[Image: badlydrawnbandaid.png]

( http://img96.imageshack.us/img96/1690/badlydrawnbandaid.png )

Also I keep it at the size 1,3, since that's when my texture looks most like a bandaid.

Tool = script.Parent

[lua]function Heal()
if Tool.Parent.Parent.Character.Health ~= Tool.Parent.Parent.Character.MaximumHealth then
Tool.Parent.Parent.Character.Health = Tool.Parent.Parent.Character.Health + 50
Tool.Holdable = false
Tool:remove()
else
Tool.Parent.Parent.Character.MaximumHealth = Tool.Parent.Parent.Character.MaximumHealth + 25
Tool.Parent.Parent.Character.Health = Tool.Parent.Parent.Character.MaximumHealth
Tool.Holdable = false
Tool:remove()
end
end

link(Tool.MouseDown, Heal)[/lua]


RE: I'm going to be making some tools for anyone to use. - DSiDewd - 04-03-2011

(04-03-2011, 10:38 AM)Duck Wrote: Here's my first one, a nice simple RBX.Lua translation (Although I modified it a bit)

It's basically a Bandaid.

It should be Holdable and I made a texture (although you can make your own obviously Tongue
[Image: badlydrawnbandaid.png]

( http://img96.imageshack.us/img96/1690/badlydrawnbandaid.png )

Also I keep it at the size 1,3, since that's when my texture looks most like a bandaid.

Tool = script.Parent

[lua]function Heal()
if Tool.Parent.Parent.Character.Health ~= Tool.Parent.Parent.Character.MaximumHealth then
Tool.Parent.Parent.Character.Health = Tool.Parent.Parent.Character.Health + 50
Tool.Holdable = false
Tool:remove()
else
Tool.Parent.Parent.Character.MaximumHealth = Tool.Parent.Parent.Character.MaximumHealth + 25
Tool.Parent.Parent.Character.Health = Tool.Parent.Parent.Character.MaximumHealth
Tool.Holdable = false
Tool:remove()
end
end

link(Tool.MouseDown, Heal)[/lua]

[Image: bndd.png]
Band-aids look more like this in real life.


RE: I'm going to be making some tools for anyone to use. - Duck - 04-03-2011

(04-03-2011, 03:12 PM)DSiDewd Wrote: [Image: bndd.png]
Band-aids look more like this in real life.

Who needs realism when you have a bandaid.


RE: I'm going to be making some tools for anyone to use. - Scripter - 04-03-2011

Now it needs a sound Tongue


RE: I'm going to be making some tools for anyone to use. - Duck - 04-03-2011

(04-03-2011, 06:48 PM)Scripter Wrote: Now it needs a sound Tongue

I don't know how to add them D: