Disable Jump for all players on the Server

Where should I put the group rank stuff? As I don’t want the GUI to show for everyone.

Well, now it depends on your game, sorry but I can’t do anything about it.

Alright, thank you for your input though!

Imma see all the above post soon and try to do what you want, sorry but I didn’t see all of them above.

Please don’t just provide huge blocks of code, try and explain it somewhat, or it doesn’t help at all.

What? I mean you missed an if statement…

local Fram = script.Parent.EnableForM
local plr = game.Players.LocalPlayer
local ID = your group id
-- replace "your group id" with the actual id of the group!

plr.Character.Humanoid:GetPropertyChangedSignal("JumpPower"):Connect(function()
	game.Players.PlayerAdded:Connect(function(Player)
		if Player:GetRankInGroup(ID) == 200 
		if plr.Character.Humanoid.JumpPower == 0 then
-- you missed the IF in the line above
		Fram.Visible = true
		end
end)

script.Parent.MouseButton1Click:Connect(function()
	if plr.Character.Humanoid.JumpPower == 0 then
		plr.Character.Humanoid.JumpPower = 50	
	end
end)

I’m not exactly sure what you are trying to do however, so could you explain that to me?

local ContextActionService = game:GetService("ContextActionService")

ContextActionService:UnbindAction("jumpAction")

This script will disable the jump.

This script does work really well however when I look at it, the “if” statement is underlined in the output it says

Players.Bear23913.PlayerGui.JumpDisable/EnableGUI.Jump.LocalScript:9: Expected 'then' when parsing if statement, got 'if' 

Which line? Could you show me?

Which line? Could you show me?

It would be the line;

if plr.Character.Humanoid.JumpPower == 0 then

I’m confused, the line you provided doesn’t match up with

Perhaps you showed the wrong line, or wrong code?

Woops, wrong script I mean in this script,

local Fram = script.Parent.EnableForM
local plr = game.Players.LocalPlayer
local ID = 6418380
-- replace "your group id" with the actual id of the group!

plr.Character.Humanoid:GetPropertyChangedSignal("JumpPower"):Connect(function()
	game.Players.PlayerAdded:Connect(function(Player)
		if Player:GetRankInGroup(ID) == 209 
			if plr.Character.Humanoid.JumpPower == 0 then
				-- you missed the IF in the line above
				Fram.Visible = true
			end
	end)

	script.Parent.MouseButton1Click:Connect(function()
		if plr.Character.Humanoid.JumpPower == 0 then
			plr.Character.Humanoid.JumpPower = 50	
		end
	end)

in the line

			if plr.Character.Humanoid.JumpPower == 0 then

See this line? You have an if, but what are you missing?

Refrence this for how to write an if statement.

Oh yea, the ‘then’ statement, I will try see if that works!

Also, you forgot to add an ‘end’. Make sure you put it at the right place!

1 Like

Sorry for the late reply however whenever I try to add any changes to this script;

local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

script.Parent.MouseButton1Click:Connect(function()
	Event:FireServer()
end)

Whether its in a different place In the workspace it just breaks, I don’t know why especially when I need to add the rank whitelist script to it.

Of course it’ll break - it’s checking when the parent of the script is clicked, and if it’s parented to something that isn’t a button, it won’t work.

I know this has been 2 months since the last reply however, I am unsure how to make a GUI thats local, when you press the button it enables the jump for the local player, here is the script i’ve got so far,

-- local GroupID = "6418380"

-- local minrank = "5"

local RS = game.ReplicatedStorage.JumpToggle

local TB = script.Parent

--[[game.Players.PlayerAdded:Connect(function(player)

if player:GetRankInGroup(GroupID) <=minrank then

script.Parent.Parent.Parent.EnableJumping:Destroy()

end

end) ]]--

script.Parent.MouseButton1Click:Connect(function()

script.Parent.Parent.Enabled = false

game.LocalPlayer.Humanoid.CharacterJumpPower = 50

end)

I changed it to; However, I am not sure why it doesn’t work.

script.Parent.MouseButton1Click:Connect(function(plr)
	script.Parent.Parent.Enabled = false
	plr.CharacterJumpPower = 50
end)

I managed to get it working, however here is the script I’ve got and it works, however, the rank whitelist doesn’t work.

local GroupID = "6418380"
local minrank = "254"


game.Players.PlayerAdded:Connect(function(Player)
		if Player:GetRankInGroup(GroupID) >= minrank then
		script.Parent.Visible = false
	end
end) 

script.Parent.MouseButton1Click:Connect(function(plr)
	script.Parent.Visible = false
	for _, Player in pairs(game.Players:GetPlayers()) do
		local Character = Player.Character
		if Character then
			Character.Humanoid.JumpPower = 50
		end
	end
end)
1 Like