#why did it print "you lost" when the bot havent touched the blue part yet?

1 messages · Page 1 of 1 (latest)

twilit tulip
#

i was trying to make a tower defense game, i tested if the bot touch the blue part it will print you lost but it just print "you lost" right after i start the script

woven grove
#

The part itself is not anchored and triggered that event just by falling onto the baseplate

rocky lantern
#

check if enemy in base is an enemy

#

like add a tag

#

I would make a module loader and then have all my classes inside that

#

and then load them

#

then have a start function

#

to rage them all

#

tag*

#

so then you check their tag and you can call functions on it

lime ether
twilit tulip
#

Im at school ill try it when i gor home thanks for the help

twilit tulip
#

it worked tysm

sharp kite
#

it solved i see but touched is not good idea to detect when enemy gets to your base.

twilit tulip
#

isnt it just execute the code when an enemies touches it

sharp kite
#

it just not good, you can do something like when all waypoints are done or just placing print("you lost") after this thing

twilit tulip
quiet frostBOT
#

studio** You are now Level 1! **studio

twilit tulip
#

but i plan to make multiple "bases" and moveable "bases" mechanic for my game

#

for example a map may have 2 bases and if something happens the bases will move

#

think of it like arknights tower defense mechanic

#

wait actually nvm i can just put them codes after nvm nvm mb gng

#

tysm for the tip

sharp kite
#

sometimes touched works not right

#

even if lkook

#

at your video

#

touched worked 7 times

#

and if you planning to add base health

#

sometimes it will deal damage wrong

#

actully you can modificate script

#

to make touched work 1 time

#

but it still not very good idea

#

to use .Touched

twilit tulip
#

okay tysm i changed to code so when the waypoint = 3, but are there any way to execute it when waypoint = the last point (for example the waypoint can be 26 and i have to set the script to execute at waypoint = 26 ion wanna do that

twilit tulip
#

I put that waypoint script inside the rig

#

For example in the move script i can set up the waypoint so that when the npc touch the part it will increase the waypoint value +1 but the waypoint value is only visible and changeable in that move script, if i try to find that waypoint value inside serverscriptstorage i cant

#

I think i put the move script inside a module script and require it ?