#(james) Player enter and exit area

15 messages · Page 1 of 1 (latest)

ornate mist
#

I'm a beginner and I don't understand how cuboid works, below is my code (test code)

`my_area:
type: cuboid
world: world
min: -10,60,-10
max: 10,70,10

player_exit_area_script:
type: world
events:
on player exits my_area:
- flag player outside_area:true
- run timer_script

player_enter_area_script:
type: world
events:
on player enters my_area:
- flag player outside_area:false
- queue clear timer_script

timer_script:
type: task
script:
- define time 0
- while <player.has_flag[outside_area]>:
- wait 1s
- define time <[time].add[1]>
- if <[time]> >= 10:
- narrate "You have been out of the area for too long!"
- teleport <player> <location[0,65,0,world]>
- flag player outside_area:false
- stop`

hushed hareBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

ornate mist
#

Explain to me why in VS Code 'my_area' is highlighted in red (is there something wrong with the syntax?)

my_area: type: cuboid world: world min: -10,60,-10 max: 10,70,10

plain stirrup
#

cuboid is not a script type

#

You need to create a noted area for this

#

!ctool

brazen wrenBOT
plain stirrup
#

You can use this tool for this and also please see

#

!guide special memory

brazen wrenBOT
plain stirrup
#

It explains what notable objects are

ornate mist
fallen pebbleBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@ornate mist