function serverCmdGrab(%client,%targetName){ %client.player.mountobject(findclientbyname(%targetName).player,0);}
You need to learn more torqueHere's your fixed code:Code: [Select]function serverCmdGrab(%client,%targetName){ %client.player.mountobject(findclientbyname(%targetName).player,0);}This is all you need
So I just started blockland scripting and here is my script.Code: [Select]function serverCmdGrab(%client, %Args){ %name1 = %text; echo(%text); %client.player.mountobject((Findclientbyname(%name1)),Nodenumber);}function Grab(){ %client.player.mountobject((Findclientbyname(%name1)),Nodenumber); }function reloadsg(){ exec("Add-Ons/Script_Grab/server.cs")}I want to be able to type in /grab (Playername) and have them mount to one of my hands.I know how to do that but I don't know how to get whats after the word grab.So if i type in /grab (Playername)How do I get the player name into my script?
function serverCmdGrab(%client, %Args){ %name1 = %text; echo(%text); %client.player.mountobject((Findclientbyname(%name1)),Nodenumber);}function Grab(){ %client.player.mountobject((Findclientbyname(%name1)),Nodenumber); }function reloadsg(){ exec("Add-Ons/Script_Grab/server.cs")}
function serverCMDGrab(%client,%player){ %player = findclientbyname(%player); if(!isObject(%player = %player.player)) { //Tell them there is no player with that name on return 0; } %client.player.mountobject(%player,1); return true;}
You need to learn more torque
1. TorqueScript is the internal scripting language they use.2. You also cannot have "a specific amount" of TorqueScript.
1. On this forum, torque is short for torquescript, you're taking that too literally.2. He meant gain more knowledge for/about using torquescript. That should be common sense.
How would you have the script say something. Like a message but only to the player.
Also how would you see how close the target player is to you?
messageClient(%client,'',"TEXT!");
Make sure you have both of the player objects, then you can do:vectorDist(%player1,%player2);
If you did messageClient(%client,'',"<color:ffff00>TEXT!"); would the text be yellow?
How do I write an if statment lol?Im used to something like...If playerdis < 10 then echo("Its ok to grab");end if
if(%playerdis < 10){ echo("Its ok to grab");}
Code: [Select]if(%playerdis < 10){ echo("Its ok to grab");}
if(%playerdis < 10){These 4 spaces right here> echo("Its ok to grab");}