Staff Pick: Double Jump
By
AnthonyCreated: 2014/12/02 21:37:52 UTC-08:00 (10 years and 22 days ago)
Edited: 2014/12/28 16:46:29 UTC-08:00 (9 years and 361 days ago)
Likes: 1
Staff pick as of: 2014/12/02 21:44:42 UTC-08:00 (10 years and 22 days ago)
Denizen Version: 0.9.6-b1546
Script Version: 1.0
Description:
Double Jumper
Let your players do double jumps.
Upload this script to your scripts folder and reload. Players with the fly_enabled flag will be able to fly.
Download script |
View raw script# ---------------------------------------------------------------------------- #
# |
# |
# D o u b l e J u m p e r |
# |
# Let your players do double jumps |
# |
# |
# Author: |Anthony| |
# Version: 0.2 |
# dScript Version: 0.9.6-b1546 |
# |
# ---------------------------------------------------------------------------- #
# |
# |
# ABOUT: |
# |
# Players will be able to do double jumps. You can set a flag to let |
# some folks actually fly. |
# - flag <player> fly_enabled |
# |
# |
# ---------------------------------------------------------------------------- #
DoubleJump:
type: world
debug: false
speed: 0
events:
on player joins:
- wait 1t
- adjust <player> can_fly:true
on player changes gamemode:
- wait 1t
- adjust <player> can_fly:true
on player walks:
- if <c.new_location.y.is[LESS].than[<c.old_location.y>]||false> {
# - narrate "Down"
- if <c.new_location.sub[0,0.1,0].material.is_solid||false> {
- queue clear
}
- if <player.has_flag[falling]||false> {
- queue clear
}
- flag <player> falling:<c.old_location>
- if <player.has_flag[jumping]||false> {
- event "player jump|player stops jumping" context:state|stop|to_location|<c.old_location>|from_location|<player.flag[jumping]>
- flag <player> jumping:!
}
- event "player fall|player starts falling" context:state|start|from_location|<c.old_location>
- while <player.location.sub[0,0.1,0].material.is_solid.not||false> {
- if <player.is_online.not> {
- while stop
}
- wait 1t
}
- event "player fall|player stops falling" context:state|stop|to_location|<player.location.simple.as_location>|from_location|<player.flag[falling].as_location>
- flag <player> falling:!
- queue clear
}
- if <c.new_location.y.is[MORE].than[<c.old_location.y>]||false> {
# - narrate "Up"
- if <c.new_location.y.sub[<c.old_location.y>].is[==].to[0.5]> {
- queue clear
}
- if <c.new_location.sub[0,0.1,0].material.is_solid||false> {
- queue clear
}
- if <player.has_flag[jumping]||false> {
- queue clear
}
- if <player.has_flag[falling]||false> {
- queue clear
}
- flag <player> jumping:<c.old_location>
- event "player jump|player starts jumping" context:state|start|from_location|<c.old_location>
- queue clear
}
on player stops falling:
- define fallDistance '<c.from_location.y.sub[<c.to_location.y>]||0>'
- if <player.has_flag[launched]||false> {
- queue clear
}
- if <player.has_flag[doublejump]> {
- adjust <player> can_fly:false
- adjust <player> 'fall_distance:<def[fallDistance].mul[0.70].sub[3]>'
- wait 1t
- adjust <player> can_fly:true
- flag player doublejump:!
}
else {
- adjust <player> can_fly:false
- adjust <player> 'fall_distance:%fallDistance%'
- wait 1t
- adjust <player> can_fly:true
}
on player starts flying:
- if <player.has_flag[doublejump]> {
- determine CANCELLED
}
- if <player.has_flag[fly_enabled]||false>
|| <player.gamemode.id.is[==].to[1]> {
Line with no clear purpose - missing a -dash- or :colon:?
- queue clear
}
- flag player doublejump
- shoot <player> 'o:<player>' 'destination:<player.location.cursor_on[<player.flag[double_jump_multiplier].as_int||10>]>' no_rotate
- wait 5t
- adjust <player> can_fly:false
- adjust <player> 'fall_distance:0'
- wait 5t
- adjust <player> can_fly:true
#
View History