This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum 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.
Locked
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: 190
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: 24

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

Locked