Jump to content
  • 0

Help with dash skript


Oculuz33

Question

options:
    Cooldown: 2 seconds
    Speed: 2
    
on right click with a shield:
	if player is holding shield named "&4&litemname":
		Dash(player)
        
function Dash(p: player):
    set {_u} to {_p}'s uuid
    if {dash.last::%{_u}%} is set:
        set {_wait} to difference between {dash.last::%{_u}%} and now
    else:
        set {_wait} to {@Cooldown}
    if {_wait} >= {@Cooldown}:
        set {dash.last::%{_u}%} to now
        if {_p} is on ground:
            push {_p} forwards at speed {@Speed}
        else:
            push {_p} forwards at speed {@Speed} / 2
    else:
        send action bar "&citemname: %difference between {_wait} and {@Cooldown}% left" to {_p}

when i try with a shield named "Shield" i can dash for some reason, but i want it to work on only a shield named "&4&litemname"

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
options:
    Cooldown: 2 seconds
    Speed: 2
    
on right click:
	if player is holding shield named "&4&litemname":
		Dash(player)
        
function Dash(p: player):
    set {_u} to {_p}'s uuid
    if {dash.last::%{_u}%} is set:
        set {_wait} to difference between {dash.last::%{_u}%} and now
    else:
        set {_wait} to {@Cooldown}
    if {_wait} >= {@Cooldown}:
        set {dash.last::%{_u}%} to now
        if {_p} is on ground:
            push {_p} forwards at speed {@Speed}
        else:
            push {_p} forwards at speed {@Speed} / 2
    else:
        send action bar "&citemname: %difference between {_wait} and {@Cooldown}% left" to {_p}

try this

Every time you tell a lie, You'll have to tell a 100 more.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...