Use player spectator mode in a max 500 blocks radius

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

AkroDogy2005

Member
Apr 20, 2018
18
1
3
24
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?
[doublepost=1584960338,1584892766][/doublepost]Hello?
 
First of all, please use the correct format as shown:
Code:
 command /house [<text>] [<text>] [<number>]:
   trigger:
     if arg-1 is "view"
       teleport player to %arg-2%
       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:
 command /house [<text>] [<text>] [<number>]:
   trigger:
     if arg-1 is "view"
       teleport player to %arg-2%
       execute console command "gamemode spectator %player%"
       wait 1 second
       set {location.%player%} to %location%


if %difference of {location.%player%} and %location%% is 500:
  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%)
 
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?
[doublepost=1584960338,1584892766][/doublepost]Hello?
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_language.skript:
command /house [<text>] [<text>] [<number>]:
    trigger:
        if arg-1 is "view":
            teleport player to arg-2
            set player's gamemode to spectator
            set {spectatormode.%player%} to true
        
on any move:
    if {spectatormode.%player%} is true:
        if distance between {your.sethome.variable} and player > 499:
           cancel event
I didnt tested it, but i think that it should works.
 
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
 
Status
Not open for further replies.