Disclaimer: I am reposting this because I originally posted this question WAAAAY too late at night so nobody noticed it.
--------------------------------------------------------------------------------------------------------------------------------I want to make a game mode where when you join the Players Team, you have low gravity. I also can't change gravity in the workspace because I don't want the people who die to be able to jump still.
I tried this but...
1 | local Playing = game.Teams.Players |
2 |
3 | if game.Players.LocalPlayer.Team = = Playing then |
4 | game.Players.LocalPlayer.JumpForce = 34 |
5 | end |
... it doen't work /:
First, you should make a Script, in ServerScriptService to let the client know which team is playing.
01 | Teams = { |
02 | game.Teams.RedTeam; |
03 | game.Teams.BlueTeam; |
04 | } ; |
05 |
06 | -- game.ReplicatedStorage.CurrentTeam is an ObjectValue |
07 |
08 | while wait( 60 * 5 ) do -- 5 minutes per round |
09 | if game.ReplicatedStorage.CurrentTeam.Value = = Teams [ 1 ] then |
10 | game.ReplicatedStorage.CurrentTeam.Value = Teams [ 2 ] |
11 | else |
12 | game.ReplicatedStorage.CurrentTeam.Value = Teams [ 1 ] |
13 | end |
14 | end |
The client, anywhere but ServerScriptService, a LocalScript:
1 | local MyTeam = game.Players.LocalPlayer.TeamColor |
2 |
3 | game.ReplicatedStorage.CurrentTeam.Changed:connect( function () |
4 | if game.ReplicatedStorage.CurrentTeam.TeamColor ~ = MyTeam then |
5 | workspace.Gravity = 216 -- default gravity |
6 | else |
7 | workspace.Gravity = 50 -- low gravity |
8 | end |
9 | end |
Note: JumpForce
does not exist, however, JumpPower
does.
Player's character properties are found in: game.Players.PlayerNameHere.Character.Humanoid
Hope I helped!