So, I took some code from around the forums and compiled it into this overhead floater, which, in theory, should float over my head, play and stop music, stop following me, have a lololol trail, and follow other people. I used the find command idea using "/follow " trigger. I haven't tested this yet, but I just wanted to know someone's opinion on it.
Cheers!
Code:
@name AwesomeChip
@persist Vectorz:vector Vector:vector E:entity CurPos:vector
#Timers and trails
#YES, I KNOW THAT I COPIED PEOPLES' SCRIPTS. I JUST WANTED TO USE THEM AS A BASE FOR MY OWN.
#If anyone has any problems with me copying them, I will remove them from the thread.
if(first())
{
runOnTick(1)
runOnChat(1)
entity():setTrails(50,50,3,"trails/lol",vec(255,255,255),200)
}
#If run on game ticks
if(tickClk())
{
if(entity():isConstrained()) {
E=entity():isConstrainedTo()
}
else {
E=entity()
}
Vector=owner():pos()-E:pos()+vec(0,0,100)
E:applyForce(1*(2*Vector+30*$Vector))
}
#When something is said
if(chatClk(owner())){
Said = owner():lastSaid():lower()
if(Said:find("/music_disco")){
hint("Music: HL1 Disco Remix", 5)
entity():soundPlay(1,0,"music/HL1_song25_REMIX3.mp3")
}
}
#When something is said
if(chatClk(owner())){
Said = owner():lastSaid():lower()
if(Said:find("/music_stillalive")){
hint("Music: Still Alive", 5)
entity():soundPlay(1,0,"music/portal_still_alive.mp3")
}
if(chatClk(owner())){
Said = owner():lastSaid():lower()
if(Said:find("/music_rock")){
hint("Music: Combine Theme", 5)
entity():soundPlay(1,0,"music/hl2_song15.mp3")
}
}
if(Said:find("/nomusic")){
hint("Music off", 5)
soundStop(1)
}
}
if(Said:find("/stay")){
Follow = 0
hint("Staying at current world position", 5)
CurPos = E:pos()
}
if(Said:find("/followme")){
Follow = 1
hint("Following you", 5)
CurPos = E:pos()
}
if (owner():latsSaid():find("/follow ")) {
Follow = 0
Name = Owner:lastSaid():sub(9, owner():lastSaid():length())
Target = findPlayerByName(Name)
Vectorz=Target:pos()-E:pos()+vec(0,0,100)
E:applyForce(1*(2*Vectorz+30*$Vectorz))
hint("Following "+ Name, 5)
}
if(Follow == 0){
if(tickClk())
{
if(entity():isConstrained()) {
E=entity():isConstrainedTo()
}
else {
E=entity()
}
}
}
Bookmarks