Skript Speed Issue

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Grenax

Member
May 27, 2021
1
0
1
24
Hello! I'm currently working on a dungeon-crawler type server. One of the items that mages are going to be able to use is called the "Ghost Cloak". The skript for it isn't working so great. Here is what I have:

Code:
command /ghostcloak:
    permission: op
    permission message: "&cYou do not have permission to do that!"
    trigger:
        give player unbreakable chainmail chestplate named "&5Ghost Cloak" with lore "&7Health: &a+25 HP" and "&7Defense: &a+15" and "" and "&6Item Ability: Phantom Zone &e&lSHIFT" and "&7When sneaking, gain &f✦ Speed 8" and "&apotion effect&7. Spooky!"

on player toggle sneak:
    if name of player's chestplate is "&5Ghost Cloak":
        player is sneaking
        set player's walk speed to 8
        player isn't sneaking
        set player's walk speed to 1
    if name of player's chestplate isn't "&5Ghost Cloak":
        set player's walk speed to 1

It works but if you unshift, you still have the speed bonus and even if you take the chestplate off AFTER shifting, you still gain the speed. I've tried everything I can but I can't figure this out. Please help!

Thanks,
Grenax
(also, if i take a while to respond to you it is probably because i am getting right off after i make this forum post. if you need me to reply with something, check back tomorrow and i may get back to you. sorry in advance. thank you for your patience!)
 
I don`t know but try this:
on player toggle sneak:
if name of player's chestplate is "&5Ghost Cloak":
if player is sneaking:
set player's walk speed to 8
else:
set player's walk speed to 1
else:
set player's walk speed to 1
 
Status
Not open for further replies.