1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Chat JSON?

Discussion in 'Requests' started by aseald, Feb 25, 2017.

  1. aseald

    Supporter

    Joined:
    Jan 26, 2017
    Messages:
    16
    Likes Received:
    3
    Category:
    Chat
    Suggested name:
    Anything really I'm just interested in the function.
    What I want:
    So I've seen on other servers where when player's chat you can hover over their name tags/name to see some information on the player and I'd like to add this to my server. On my server all staff will have the same tag that reads [Staff] and I would like this to show their roles on the server. Also I have a leveling skript that I've been working on so it would be nice to show the level variable along with balance on hover.

    Ideas for commands:
    /roles [<add/remove>] <text>
    /roles [<offlineplayer>]

    Ideas for permissions:
    prefix.add.roles
    prefix.remove.roles
    When I'd like it by: Within a week but the sooner the better. Heck I'd be grateful if someone even attempted this for me.
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    What is the display variable from your leveling script?
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    {lvl::%player's uuid%}
    Thank you for viewing my thread x)
    --- Double Post Merged, Mar 9, 2017, Original Post Date: Feb 25, 2017 ---
    bump?
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Add me on skype, Jacobmc0804 - I've made this before :emoji_wink:
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Could just do something like

    Code (Skript):
    1. on chat:
    2.     cancel event
    3.     loop all players:
    4.             if player is op:
    5.                 json("%loop-player%","blah blah||ttp: enter hover info|| %player% %message")
    6.             else:
    7.                 json ("%loop-player%","blah")
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    I thought that syntax was broken after 1.8
    --- Double Post Merged, Mar 15, 2017, Original Post Date: Mar 15, 2017 ---
    Cannot find your skype :/
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Yeah that works.
    No it isn't. Also you need json.sk
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Thank you. :emoji_slight_smile:
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Is it possible to modify the message itself instead of change it from the message to a json?
    I use PurpleIRC that broadcast the in-game messages to IRC but it doesn't hooks into json and broadcast messages.
    Do you know a workaround for it? Thanks!
    --- Double Post Merged, Mar 24, 2017, Original Post Date: Mar 22, 2017 ---
    You guys know? Snow-Pyon YoshYz
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    You could try to cancel the chat packet and modify it
     
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    If i cancel the IRC wont get it.
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    if you cancel "on chat:" you cancel sending the message
    if you cancel "on packet event play_server_chat:" you cancel recieving the message

    Code (Skript):
    1. on packet event play_server_chat:
    2.     set {_jsonText} to "%""chatcomponent"" pjson 0 of event-packet%"
    3.     execute console command "/tellraw %player% %{_jsonText}%
    Note that this will crash your Server, it's just an example.
     
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    I don't get it. Why it crashes the server?
     
Loading...