Jump to content
  • 0

i am making a fly enchant and i cant make it a function


cat_rebellion

Question

so i am making a enchant that make's the player get a litle boost in speeed and it works but when i tried to make it a function it dident work this is what i have

and it gives me these erors
error #3 

variables cant be used heare 

    error 1 variables cant be used heare push the {_p} forward at speed {_F} parsed as number

    error 2 cant understand condition if {_waited} is less than {_Time} - {_en} seconds:

    error 3 cant be set to uncolored lore of player's/{_p} held item set {_lore::*} to uncolored lore of {_p} held item

 

 
function Fly(p: player😞
  set {_lore::*} to uncolored lore of {_p} held item
  loop {_lore::*}:
    set {_en} to loop-valu
    replace all "Fly" with "" in {_en}
    set {_F} to {_force} + 0.25 * {_en}
    set {_waited} to difference between {fly.%{_p}%.lastused} and now
    if {_waited} is less than {_Time} - {_en} seconds:
      message "&8&l[&a&lServer&8&l] &cPlease wait &3%difference between {_Time} - {_en} seconds and {_waited}% seconds before trying again" to {_p}
      stop
    push the {_p} forward at speed {_F} parsed as number
    set {fly.%{_p}%.lastused} to now
 
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

the original skript
 

#Fly Enchantment I
on rightclick holding a feather:
  if the 1st line of player's held item's lore is "&7&lFly I":
    set {_waited} to difference between {fly.%player%.lastused} and now
    if {_waited} is less than 5 seconds:
      message "&8&l[&a&lServer&8&l] &cPlease wait &3%difference between 5 seconds and {_waited}% seconds before trying again"
      stop
    push the player forward at speed 1
    set {fly.%player%.lastused} to now
 
#Fly Enchantment II
on rightclick holding a feather:
  if the 1st line of player's held item's lore is "&7&lFly II":
    set {_waited} to difference between {fly.%player%.lastused} and now
    if {_waited} is less than 5 seconds:
      message "&8&l[&a&lServer&8&l] &cPlease wait &3%difference between 5 seconds and {_waited}% seconds before trying again"
      stop
    push the player forward at speed 1.25
    set {fly.%player%.lastused} to now
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...