Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Script problem Co-op

Share questions, scripts and tutorials related to the ScriptAPI in SFD.
Forum rules
By using the forum you agree to the following rules.
Post Reply
JojofansWhen
Meatbag
Posts: 1
Joined: Fri Sep 22, 2023 7:43 am
SFD Account: ezest account eva

Script problem Co-op

Post by JojofansWhen » Fri Sep 22, 2023 7:48 am

Hello. My friend and i play sfd on occasion and we use scripts on local match but how do we modify each player with scripts for example my friend wants to have jetpack script activated but i want Grappling Hook activated. How do we do that? And is there a way to keep stats in next match when using command+ script? My friend and i keep typing scripts and it is frustrating to play like that. Any easier alternatives to recommend for us? :roll:
0 x

User avatar
Mighty Spirit the 2
Superfighter
Superfighter
Posts: 187
Joined: Mon Jun 25, 2018 5:02 pm
Title: Wasted potential
SFD Account: ake004
SFD Alias: Retired SFD player
Started SFD: When melee was good
Location: SFD Veteran trauma hospital
Gender:
Age: 22

Post by Mighty Spirit the 2 » Wed Oct 11, 2023 10:35 pm

I have one very simple version of the JetPack script by "ClockworkDice", and that works via any player walking like this:

Code: Select all

	foreach(IPlayer ply in Game.GetPlayers()){
		if(ply.IsWalking){
			ply.SetLinearVelocity(ply.GetLinearVelocity() + new Vector2(0,3));
		}
	}
The absolute easiest way would be to write in your characters name here, so the script only works for you. For example your name is "Chakan".

Code: Select all

	foreach(IPlayer ply in Game.GetPlayers()){
		if(ply.IsWalking && ply.Name == "Chakan"){
			ply.SetLinearVelocity(ply.GetLinearVelocity() + new Vector2(0,3));
		}
	}
Another way is to directly write in the slots of both Users players, regardless of name. Like the example below only works for the host player, you can write [1] in there to only apply for the 2nd connected player.

Code: Select all

	foreach(IPlayer ply in Game.GetPlayers()){
		if(ply.IsWalking && ply == Game.GetActiveUsers()[0].GetPlayer() ){
			ply.SetLinearVelocity(ply.GetLinearVelocity() + new Vector2(0,3));
		}
	}
I haven't seen the code for Grappling Hook, but if it's the similar as the one above, just edit for your friend name/slot in.

I don't know about Commands+, i think you should ask the author Odex.
1 x
🎶I will tell your story if you die
I will tell your story and keep you alive the best i can
...
But I've always had the feeling we would die young
Some die young
🎵
https://i.imgur.com/D479VLi.png

Post Reply