tempera Posted April 28, 2021 Share Posted April 28, 2021 (edited) First of all, I am not a native speaker, sorry for my english! Although I code java, I am very new to skript, so this will probably be a trivial thing that I am missing here. My code just will not set the variable and whenever I step on a portal it will say it does not have a target. on break end portal frame: if event-player is sneaking: cancel event set {selectedPortal} to event-block send action bar "§b§lSelected portal! Do '/portal settarget' to set the portal target!" to event-player command /portal settarget: permission: portal.settarget trigger: set {portals.selectedPortal} to event-player's location send action bar "§b§lPortal target set! Now just walk over it!" to event-player on walk on end portal frame: if {portals.event-block} is not set: send action bar "§c§lThis portal does not have a target yet!" to event-player stop trigger teleport event-player to {portals.event-block} play sound "entity.enderman.teleport" with volume 1 and pitch 1 to event-player Edited April 28, 2021 by tempera Link to comment Share on other sites More sharing options...
Pryzmm Posted April 28, 2021 Share Posted April 28, 2021 1 minute ago, tempera said: Although I code java, I am very new to skript, so this will probably be a trivial thing that I am missing here. My code just will not set the variable and whenever I step on a portal it will say it does not have a target. on break end portal frame: if event-player is sneaking: cancel event set {selectedPortal} to event-block send action bar "§b§lSelected portal! Do '/portal settarget' to set the portal target!" to event-player command /portal settarget: permission: portal.settarget trigger: set {portals.selectedPortal} to event-player's location send action bar "§b§lPortal target set! Now just walk over it!" to event-player on walk on end portal frame: if {portals.event-block} is not set: send action bar "§c§lThis portal does not have a target yet!" to event-player stop trigger teleport event-player to {portals.event-block} play sound "entity.enderman.teleport" with volume 1 and pitch 1 to event-player do {portals.%event-block%} as just doing event-block is different and wont work Owner of Lifestealed, Labs, Encore, UNOfficially and Observed OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - 5/8/2024 [MOD] 5/8/2024 - Present Link to comment Share on other sites More sharing options...
tempera Posted April 28, 2021 Author Share Posted April 28, 2021 I tried it and unfortunaly it still doesnt work. Link to comment Share on other sites More sharing options...
Pryzmm Posted April 28, 2021 Share Posted April 28, 2021 Just now, tempera said: I tried it and unfortunaly it still doesnt work. 1. if you're going to make multiple event-block locations inside a single variable, use a list variable (ex. {MyVariable::Extra::*}) the * at the end calls for everything in that extra list variable. 2. at the beginning use {portals.SelectedPortal} instead of {SelectedPortal} as this makes it think its its own variable Owner of Lifestealed, Labs, Encore, UNOfficially and Observed OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - 5/8/2024 [MOD] 5/8/2024 - Present Link to comment Share on other sites More sharing options...
tempera Posted April 28, 2021 Author Share Posted April 28, 2021 I changed to this and it still does not work: on break end portal frame: if event-player is sneaking: cancel event set {selectedPortal} to event-block send action bar "§b§lSelected portal! Do '/portal settarget' to set the portal target!" to event-player command /portal settarget: permission: portal.settarget trigger: set {portals::selectedPortal::*} to event-player's location send action bar "§b§lPortal target set! Now just walk over it!" to event-player on walk on end portal frame: if {portals::event-block::*} is not set: send action bar "§c§lThis portal does not have a target yet!" to event-player stop trigger teleport event-player to {portals::event-block} play sound "entity.enderman.teleport" with volume 1 and pitch 1 to event-player Link to comment Share on other sites More sharing options...
Pryzmm Posted April 28, 2021 Share Posted April 28, 2021 1 minute ago, tempera said: I changed to this and it still does not work: on break end portal frame: if event-player is sneaking: cancel event set {selectedPortal} to event-block send action bar "§b§lSelected portal! Do '/portal settarget' to set the portal target!" to event-player command /portal settarget: permission: portal.settarget trigger: set {portals::selectedPortal::*} to event-player's location send action bar "§b§lPortal target set! Now just walk over it!" to event-player on walk on end portal frame: if {portals::event-block::*} is not set: send action bar "§c§lThis portal does not have a target yet!" to event-player stop trigger teleport event-player to {portals::event-block} play sound "entity.enderman.teleport" with volume 1 and pitch 1 to event-player set {portals::selectedPortal::*} to event-player's location Change this to "add {Portals::%{selectedPortal}%::*} to {selectedPortal}" Owner of Lifestealed, Labs, Encore, UNOfficially and Observed OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - 5/8/2024 [MOD] 5/8/2024 - Present Link to comment Share on other sites More sharing options...
tempera Posted April 28, 2021 Author Share Posted April 28, 2021 I have changed it and it still doesn't work, i have modified and it still also doesn't work. add {Portals::%{selectedPortal}%::*} to event-player's location Link to comment Share on other sites More sharing options...
Pryzmm Posted April 28, 2021 Share Posted April 28, 2021 1 minute ago, tempera said: I have changed it and it still doesn't work, i have modified and it still also doesn't work. add {Portals::%{selectedPortal}%::*} to event-player's location can you send errors? Owner of Lifestealed, Labs, Encore, UNOfficially and Observed OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - 5/8/2024 [MOD] 5/8/2024 - Present Link to comment Share on other sites More sharing options...
tempera Posted April 28, 2021 Author Share Posted April 28, 2021 It doesnt give any errors, it just says that there is not target Link to comment Share on other sites More sharing options...
Pryzmm Posted April 28, 2021 Share Posted April 28, 2021 1 minute ago, tempera said: It doesnt give any errors, it just says that there is not target Send your current code Owner of Lifestealed, Labs, Encore, UNOfficially and Observed OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - 5/8/2024 [MOD] 5/8/2024 - Present Link to comment Share on other sites More sharing options...
tempera Posted April 28, 2021 Author Share Posted April 28, 2021 on break end portal frame: if event-player is sneaking: cancel event set {selectedPortal} to event-block send action bar "§b§lSelected portal! Do '/portal settarget' to set the portal target!" to event-player command /portal settarget: permission: portal.settarget trigger: add {Portals::%{selectedPortal}%::*} to event-player's location send action bar "§b§lPortal target set! Now just walk over it!" to event-player on walk on end portal frame: if {portals::event-block::*} is not set: send action bar "§c§lThis portal does not have a target yet!" to event-player stop trigger teleport event-player to {portals::event-block} play sound "entity.enderman.teleport" with volume 1 and pitch 1 to event-player Link to comment Share on other sites More sharing options...
Pryzmm Posted April 28, 2021 Share Posted April 28, 2021 2 minutes ago, tempera said: on break end portal frame: if event-player is sneaking: cancel event set {selectedPortal} to event-block send action bar "§b§lSelected portal! Do '/portal settarget' to set the portal target!" to event-player command /portal settarget: permission: portal.settarget trigger: add {Portals::%{selectedPortal}%::*} to event-player's location send action bar "§b§lPortal target set! Now just walk over it!" to event-player on walk on end portal frame: if {portals::event-block::*} is not set: send action bar "§c§lThis portal does not have a target yet!" to event-player stop trigger teleport event-player to {portals::event-block} play sound "entity.enderman.teleport" with volume 1 and pitch 1 to event-player as i said, do {portals::%event-block%::*} not {portals::event-block::*} Owner of Lifestealed, Labs, Encore, UNOfficially and Observed OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - 5/8/2024 [MOD] 5/8/2024 - Present Link to comment Share on other sites More sharing options...
tempera Posted April 29, 2021 Author Share Posted April 29, 2021 It still does not work. I would like for you to acctualy rewrite the code the right way so i can learn Link to comment Share on other sites More sharing options...
Pryzmm Posted April 29, 2021 Share Posted April 29, 2021 32 minutes ago, tempera said: It still does not work. I would like for you to acctualy rewrite the code the right way so i can learn Here ya go: on break end portal frame: if event-player is sneaking: cancel event set {selectedPortal} to event-block's location send action bar "§b§lSelected portal! Do '/portal settarget' to set the portal target!" to event-player command /portal <text>: usage: &b/Portal (SetTarget) permission: portal.settarget trigger: if arg-1 is "SetTarget": set {Portals::%{selectedPortal}%} to location of event-player send action bar "§b§lPortal target set! Now just walk over it!" to event-player on walk on end portal frame: if {Portals::%event-block's location%} is not set: send action bar "§c§lThis portal does not have a target yet!" to event-player stop trigger teleport event-player to {Portals::%event-block's location%} play sound "entity.enderman.teleport" with volume 1 and pitch 1 to event-player Owner of Lifestealed, Labs, Encore, UNOfficially and Observed OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - 5/8/2024 [MOD] 5/8/2024 - Present Link to comment Share on other sites More sharing options...
tempera Posted April 29, 2021 Author Share Posted April 29, 2021 ty Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now