2DWorlds Forums
Damage for tools - 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: Damage for tools (/showthread.php?tid=3607)



Damage for tools - Sazaho - 04-19-2011

Can I use the Lava script to make tools damage? If so how? I put a lava script into the tool but it doesn't work...


RE: Damage for tools - Anti - 04-19-2011

Tools damage? D=
Then you probably need
Tool.MouseDown and you need to use game.World:getPartAt(mousepos) to find out if mouse is on enemy...

But if you want like melee weapon,
Tool with Holdable on
Tool.MouseDown
and make it use getTrace function to find out if theres a player hitting the "weapon"

D:


RE: Damage for tools - Sazaho - 04-19-2011

Yah, it's a melee weapon, It's holdable and it has a texture that looks great, you can swing it around so I would preferably want it to damage onTouch...

Also If i had to make it so it damages when it's touching A character, I COULD make it so it damages other people and NPCs... MUTINY!


RE: Damage for tools - AK-47 - 04-19-2011

lets just say..

If hit.Name ~= script.Parent.Parent.Name (or something like that) and hit.Parent.Type = "NPC" then

hit.Parent.Health = hit.Parent.Health - 10

sleep(.5)

end

This is when the tool collides with something.


RE: Damage for tools - Sazaho - 04-19-2011

Thanks
If hit.Body ~= script.Parent.Parent.Body

hit.Parent.Health = hit.Parent.Health - 10

sleep(.5)

end

how 'bout that


RE: Damage for tools - AK-47 - 04-19-2011

That would work, too. Simplified XD


RE: Damage for tools - Sazaho - 04-19-2011

Sweet- my first piece of working scripting Tongue


RE: Damage for tools - AK-47 - 04-19-2011

Weeee


RE: Damage for tools - Sazaho - 04-19-2011

More problems, but I posted a different thread for it, since it's a MASSIVE Problem for me.