helped me with a noob

Avatar

By LaVacheMilka 4 September 2019 19:46

Member · 130 comments

Hello I would like to know how to display or execute an action while I type a player?

Avatar

By yorik100 4 September 2019 19:49

Member · 307 comments

For anyone wondering, he wants to do something like that : .target %playername%
Otherwise he explained it badly

Avatar

By LaVacheMilka 4 September 2019 19:57

Member · 130 comments
yorik100 wrote

For anyone wondering, he wants to do something like that : .target %playername%
Otherwise he explained it badly


no, i mean i hit a player his poster his name

Avatar

By LaVacheMilka 4 September 2019 20:26

Member · 130 comments

Nobody ?

Avatar

By CzechHek 4 September 2019 21:48

Member · 314 comments

(doesn't work for AAC servers, improve it as you want, this is the most basic version)

	this.onUpdate = function () {
		if (target != null) {
			if (target.isDead) {
				mc.thePlayer.sendChatMessage("L " + target.getName());
				target = null;
			}
		}
	}
	this.onAttack = function (event) {
		target = event.getTargetEntity();
	}
}
var target;

Last edited by CzechHek (4 September 2019 21:48)


ScriptAPI Developer.
Experienced YouTuber.
Discord: v.ht/DYSKORD
YouTube: v.ht/CzechHek

Avatar

By LaVacheMilka 4 September 2019 22:41

Member · 130 comments
CzechHek wrote

(doesn't work for AAC servers, improve it as you want, this is the most basic version)

	this.onUpdate = function () {
		if (target != null) {
			if (target.isDead) {
				mc.thePlayer.sendChatMessage("L " + target.getName());
				target = null;
			}
		}
	}
	this.onAttack = function (event) {
		target = event.getTargetEntity();
	}
}
var target;

no, I want the name to be displayed on my screen when I hit the player...
Not quan and kill

Last edited by LaVacheMilka (4 September 2019 22:41)

Avatar

By yorik100 4 September 2019 23:02

Member · 307 comments
LaVacheMilka wrote
CzechHek wrote

(doesn't work for AAC servers, improve it as you want, this is the most basic version)

	this.onUpdate = function () {
		if (target != null) {
			if (target.isDead) {
				mc.thePlayer.sendChatMessage("L " + target.getName());
				target = null;
			}
		}
	}
	this.onAttack = function (event) {
		target = event.getTargetEntity();
	}
}
var target;

no, I want the name to be displayed on my screen when I hit the player...
Not quan and kill

chat.print("" + target.getName())