Sword Script/Sword fighting game

[Brick] Shadow12
Joined 03/03/2019
Posts 18
06:58 AM 03/03/2019
Hi I was thinking of making a sword fighting game and could use tips on the scripts/spawns. plz reply. ty!


[im] kahoolawe
Joined 26/01/2018
Posts 9,004
06:59 AM 03/03/2019
go away albert fan.


[Brick] Shadow12
Joined 03/03/2019
Posts 18
07:03 AM 03/03/2019
Lemme think about that... NO!


[PD] Illusionism
Joined 23/01/2019
Posts 245
02:35 AM 19/03/2019
Here's the famous sword script, by Leon:
obj_item.Model = '566eb526';

s = define("onClick");
s.script = '
var user,sword_length,sword_damage;
user = arg[0];
if user.Arm == user.tool[0] {
sword_length = 4;
sword_damage = 10;
with obj_client {
if(id != user) {
if(alive) {
if power(xPos-user.xPos,2)+power(yPos-user.yPos,2)+power((zPos+4zScale)-(user.zPos+2.5zScale),2) <= power(sword_length,2) {
playerAddDamage(id,sword_damage);
if playerGetHealth(id) <= 0 {
playerKill(id);
playerSetHealth(id,100);
messageAll(user.name+" killed "+name);
user.Score += 1;
}
}
}
}
}
}
';

1