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

[REPOST] How can I give low-gravity to a specific team?

Asked by 6 years ago

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...

1local Playing = game.Teams.Players
2 
3if game.Players.LocalPlayer.Team == Playing then
4    game.Players.LocalPlayer.JumpForce = 34
5end

... it doen't work /:

1 answer

Log in to vote
-2
Answered by 6 years ago

First, you should make a Script, in ServerScriptService to let the client know which team is playing.

01Teams = {
02    game.Teams.RedTeam;
03    game.Teams.BlueTeam;
04};
05 
06-- game.ReplicatedStorage.CurrentTeam is an ObjectValue
07 
08while 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
14end

The client, anywhere but ServerScriptService, a LocalScript:

1local MyTeam = game.Players.LocalPlayer.TeamColor
2 
3game.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
9end

Note: JumpForce does not exist, however, JumpPower does. Player's character properties are found in: game.Players.PlayerNameHere.Character.Humanoid

Hope I helped!

0
Can I do game.Players.LocalPlayer.Character.Humanoid? zboi082007 270 — 6y
Ad

Answer this question