Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I make certain scripts for certain teams?

Asked by 9 years ago

I have Werewolves vs Humans(or Vampires.. doesn't matter) And I got AWESOME animations for both teams. I ONLY want the WereWolf team to have certain "Local" scripts, with the animations as a child. And Same for the other team. I don't know how to do that. I've tried. Mind helping me out?

01wait(2)
02 
03repeat
04    wait()
05until game.Players.LocalPlayer
06 
07player = game.Players.LocalPlayer
08character = player.Character
09if not character then
10    character = player.CharacterAdded:wait()
11end
12 
13Mouse = player:GetMouse()
14humanoid = character:WaitForChild("Humanoid")
15s = humanoid:LoadAnimation(game.StarterPack.RunAnimScrip.Animation)
View all 33 lines...

3 answers

Log in to vote
2
Answered by 9 years ago

It's Very Simple

Well, it's really easy and useful to use, you can use an if function, to check if a player is wearing a certain item, doing a certain action(like jumping or walking), etc.

The Code

You can check if a player is on a team of a sort, like this!

1if game.Players.LocalPlayer.TeamColor == BrickColor.new('Really Red') then--change the Really Red to the color of your team.
2--code
3end

So...

Hopefully this helped you, if you have any more questions, just message me on Roblox.

GreekGodOfMLG

P.S

The edited version of the script you wanted and where to implant it.

01wait(2)
02repeat
03 wait()
04until game.Players.LocalPlayer
05    player = game.Players.LocalPlayer
06    character = player.Character
07    if not character then
08        character = player.CharacterAdded:wait()
09    end
10Mouse = player:GetMouse()
11humanoid = character:WaitForChild("Humanoid")
12s = humanoid:LoadAnimation(game.StarterPack.RunAnimScrip.Animation)
13ouse.KeyDown:connect(function(key)
14    key = string.lower(key)
15  if player.TeamColor = BrickColor.new ('Bright Blue') then--Change it to the team color you want.
View all 24 lines...
0
So I just replace my Team Color line with that? Also, How would I fit that in with my IF Key == 48 Line? james24dj 90 — 9y
0
I will edit my answer to help with your code :) GreekGodOfMLG 244 — 9y
0
WOOPS accidently deleated your == 48 line, just insert it before player.TeamColor, and it should work just fine. GreekGodOfMLG 244 — 9y
0
Thank you james24dj 90 — 9y
View all comments (2 more)
0
Accept my answer :D GreekGodOfMLG 244 — 9y
0
Sorry, totally forgot. I was editting james24dj 90 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Well, I'm not the best scripter, but I think I might know how to solve this one. You'd have to figure out what team a player is on by:

1game.Players.LocalPlayer.TeamColor --Not completing it, cause I don't know how to....

Then make it so that If a player is on the Black team(Dark for werewolf?), then that person would get these animations, and if a player was on the Red team(Vampires?), they'd get the other animations.

Correct me if i'm wrong... :P

Log in to vote
-5
Answered by 9 years ago

This is not what I ment sorry can't help ya, matter of fact I am terrible at scripting!

0
Seriously, this isn't forums. If you don't know or won't try to help, don't bother commenting. Sorry for my rudeness. james24dj 90 — 9y
0
kk :) lol raged. matthewwilson23 0 — 9y
0
might be if you put the script you want in one team (make two script's and put them in the teams so one script in red and one script in blue) matthewwilson23 0 — 9y

Answer this question