edikecske Posted January 29, 2021 Posted January 29, 2021 Hey, I'm struggling with a roleplay server chat. I want to make it like if a player is close he can see the text full white, but if he's further away the text turns gray for him. I use the original rageMP chat on my server and I'm trying to make something with /say command (I'm still looking for the solution that I don't have to use /say command to chat with other players). I searched a lot about this thing, but I couldn't find any resource for it. Please help me mp.events.addCommand("say", (player, message) => { let pos = player.position; mp.players.broadcastInRange(pos, 15, `${player.name} says: ${message}`); });
Kopra Posted January 30, 2021 Posted January 30, 2021 That is pretty simple script, I'll show you just part of command and you do the rest yourself. if (target.dist(player.position) < radius / 6) { target.outputChatBox(`!{${color_2}}${message}`); } else if (target.dist(player.position) < radius / 4) { target.outputChatBox(`!{${color_3}}${message}`); }
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now