may need an else at the end, or itll just stay at 1.
hey im trying to build a chat controlled transporter for players here is what i got:
it sends the cords rigth but the send just stays at 1 so if i use it, usuallly dosent work at all, or it teleports the player over and over agian till a new chat message is said...Code:@name Asgard @inputs @outputs OX OY OZ DX DY DZ Send Retrive Evrything @persist Chat:array Target:entity AimPos:vector @trigger all runOnChat(1) Chat=lastSaid():explode(":") if (Chat:string(1)=="player") { Target = findPlayerByName(Chat:string(2)) TargetPos = Target:pos() OX = TargetPos:x() OY = TargetPos:y() OZ = TargetPos:z() Evrything = 0 Send = 1 } if (Chat:string(1)=="set") { AimPos = owner():aimPos() DX = AimPos:x() DY = AimPos:y() DZ = AimPos:z() }
how do i fix this pice of crap ?
may need an else at the end, or itll just stay at 1.
Send will never return to 0 again. Add an else case.
Now haveIt outputs Send inuntill another chat message is sent + it dosent teleport, nothing happends@name Asgard
@inputs
@outputs OX OY OZ DX DY DZ Send Retrive Evrything
@persist Chat:array Target:entity AimPos:vector
@trigger all
runOnChat(1)
Chat=lastSaid():explode(":")
if (Chat:string(1)=="get")
{
Target = findPlayerByName(Chat:string(2))
TargetPos = Targetos()
OX = TargetPos:x()
OY = TargetPos:y()
OZ = TargetPos:z()
Evrything = 0
Send = 1
}
else
{
Send=0
}
if (Chat:string(1)=="set")
{
AimPos = owner():aimPos()
DX = AimPos:x()
DY = AimPos:y()
DZ = AimPos:z()
}
Please ?!!! waited an hour...
Code:"I have a better Pythagorean theorem than you"
I added a timer that makes it turn off "Send" 100ms after turning it on.
Code:@name Asgard @inputs @outputs OX OY OZ DX DY DZ Send Retrieve Everything @persist Target:entity AimPos:vector @trigger all #Whats the point in "Retrieve" if it is never set and "Everything" if its only set to 0? runOnChat(1) if (chatClk(owner())) { Chat=lastSaid():explode(":") if (Chat:string(1)=="player") { TargetPos = findPlayerByName(Chat:string(2)):pos() OX = TargetPos:x() OY = TargetPos:y() OZ = TargetPos:z() Everything = 0 Send = 1 timer("send-stop",100) } if (Chat:string(1)=="set") { AimPos = owner():aimPos() DX = AimPos:x() DY = AimPos:y() DZ = AimPos:z() } } if (clk("send-stop")) {Send=0}
(\__/) <- Put this bunny in your sig and help him to rule the world!
(='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
(")_(") Expression Gate 2 Wiki Help us update the wiki! Together we can make it more up to date than the SVN! ...
#Whats the point in "Retrieve" if it is never set and "Everything" if its only set to 0?
its not complete... different commands for each
but thanks
Code:"I have a better Pythagorean theorem than you"
Bookmarks