Jump to content

Players Dont Have Permission To Do /shoot But I Want It So When They Right Click On A Clock It Runs The Command As If They Had Op


GamerDanny09

Recommended Posts

This Is My Code:
on right click:
    if name of player's tool is "&c&lMagic Toy Stick":
        make player execute command "shoot"
        
command /shoot:
    cooldown: 5 seconds
    cooldown message: &cYou Must Wait But You Can Shoot Again In &a%remaining time%
    permission: shoot.yes
    trigger:
        make player shoot fireball at speed 1.3

Link to comment
Share on other sites

Try this

 

 

 

On right click:

    if name of player's tool is "&c&lMagic Toy Stick":

        make player execute command "shoot" as op

        

command /shoot:

    cooldown: 5 seconds

    cooldown message: &cYou Must Wait But You Can Shoot Again In &a%remaining time%

    permission: shoot.yes

    trigger:

        make player shoot fireball at speed 1.3

 

350kb.gif.0ff78007b131dd46bab00eb5980d6c35.gif

Yo_the_pro19

owner of Aqua-lands.net

rank: VIP 

 

 

Link to comment
Share on other sites

Hey, the easiest fix I can think of is to use this code:
(Note this will require you to add the skript addon plugin skUtilities (link: https://github.com/tim740/skUtilities/releases)

on right click:
    if tool of player is clock:
        if name of player's tool is "&c&lMagic Toy Stick":
            make player run command "/shoot" as op

command /shoot:
    cooldown: 5 seconds
    cooldown message: &cYou Must Wait But You Can Shoot Again In &a%remaining time%
    permission: shoot.yes
    trigger:
        make player shoot fireball at speed 1.3

 

If you like what I post or I've helped you please leave a like or upvote my posts! Thanks!

Link to comment
Share on other sites

Why don't you just make the right click event handle all of it?

on load:
    set {item::magictoystick} to stick named "&c&lMagic Toy Stick"

command /magictoystick:
    trigger:
        give 1 of {item::magictoystick} to player

on right click:
    if player is holding {item::magictoystick}:
        if difference between now and {%player's uuid%.magictoystick.lastUsed} is less than 5 seconds:
            send "&cYou Must Wait But You Can Shoot Again" to player
        else:
            make player shoot fireball at speed 1.3
            set {%player's uuid%.magictoystick.lastUsed} to now

Kinda over engineered but works the same. 

Edit:
No need to add some addon for a single skript

Edited by Amylya
No need for addon.

If i have helped you upvote my comment please, Thank you!

Joined: 5/13/2022

Amelia.exe has stopped working

 

image_2022-06-10_172852571.png

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...