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

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Use player spectator mode in a max 500 blocks radius

Discussion in 'Skript' started by AkroDogy2005, Mar 22, 2020.

  1. AkroDogy2005

    AkroDogy2005 Member

    Joined:
    Apr 20, 2018
    Messages:
    15
    Likes Received:
    1
    so i have this config

    command /house [<text>] [<text>] [<number>]:
    trigger:
    if arg-1 is "view"
    teleport player to %arg-2%
    execute console command "gamemode spectator %player%"

    I want to make something to player can't go through the blocks like a fake spectator mode and to teleport to other players and the spectator mode to be in max 500 blocks radius. Is possible?
    --- Double Post Merged, Mar 23, 2020 at 10:45 AM, Original Post Date: Mar 22, 2020 ---
    Hello?
     
  2. oHeckGage

    oHeckGage Member

    Joined:
    Tuesday
    Messages:
    18
    Likes Received:
    1
    First of all, please use the correct format as shown:
    Code (Text):
    1.  command /house [<text>] [<text>] [<number>]:
    2.    trigger:
    3.      if arg-1 is "view"
    4.        teleport player to %arg-2%
    5.        execute console command "gamemode spectator %player%"
    Second of all, what is the purpose of this
    Third of all, if I think I know what it is for:

    Code (Text):
    1.  command /house [<text>] [<text>] [<number>]:
    2.    trigger:
    3.      if arg-1 is "view"
    4.        teleport player to %arg-2%
    5.        execute console command "gamemode spectator %player%"
    6.        wait 1 second
    7.        set {location.%player%} to %location%
    8.  
    9.  
    10. if %difference of {location.%player%} and %location%% is 500:
    11.   make player execute command /spawn
    I am no skript expert but try it. Hope it helps!
    (Just saying you might have to change the %location%% to %location%)
     
  3. AkroDogy2005

    AkroDogy2005 Member

    Joined:
    Apr 20, 2018
    Messages:
    15
    Likes Received:
    1
    I ll try tomorrow thanks!
     
  4. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    436
    Likes Received:
    14
    To do what you want to do, you have to have the home point of origin selected. When you have that, do something like this:

    Code (Skript):
    1.  
    2. command /house [<text>] [<text>] [<number>]:
    3.     trigger:
    4.         if arg-1 is "view":
    5.             teleport player to arg-2
    6.             set player's gamemode to spectator
    7.             set {spectatormode.%player%} to true
    8.        
    9. on any move:
    10.     if {spectatormode.%player%} is true:
    11.         if distance between {your.sethome.variable} and player > 499:
    12.            cancel event
    I didnt tested it, but i think that it should works.
     
  5. AkroDogy2005

    AkroDogy2005 Member

    Joined:
    Apr 20, 2018
    Messages:
    15
    Likes Received:
    1
    can't understand this event: 'on any movement' (HouseManager.sk, line 66: on any movement:') ?
    i tried with on move, on any move, on movement and it doesn t work
    skript 2.4.1
     
  6. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    436
    Likes Received:
    14
    You need SkQuery to use "on any move" event.
     
Loading...