Jumppower (GroupRank-ServerScriptService)

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to make only low rank get jumppower 0 when button pressed.

  2. What is the issue?

     for i, v in pairs(game:GetService("Players"):GetChildren()) and player:GetRankInGroup(13566661) >= 3 then do
    

This part gets error.

  1. What solutions have you tried so far? Yes. but no solutions.
local AdminEvent = game:GetService("ReplicatedStorage").AdminRemote

AdminEvent.OnServerEvent:Connect(function(player, canJump)
	
	print(canJump)
	if canJump == true then

		print(canJump)
		for i, v in pairs(game:GetService("Players"):GetChildren()) and player:GetRankInGroup(13566661) >= 3 then do
			v.Character:FindFirstChild("Humanoid").JumpPower = 0
		end
		player.PlayerGui.StaffPanel.Main.Jumppower.TextLabel.Text = "Enable Passenger's Jumppower." 

	elseif canJump == false then

		print(canJump)
		for i, v in pairs(game:GetService("Players"):GetChildren()) do
			v.Character:FindFirstChild("Humanoid").JumpPower = 30
		end
		player.PlayerGui.StaffPanel.Main.Jumppower.TextLabel.Text = "Disable Passenger's Jumppower." 
	end 

end)
1 Like

you cant use “then” in for script
you have to do
for i, v in pairs(game:GetService(“Players”):GetChildren()) do
if v:GetRankInGroup(13566661) >= 3 then

1 Like

Looks like I found the new error.
in the line 15
image

1 Like

then remove “else”
just do if then

Still there is error. (30charhhh)

can you show me script with screenshot

Okay.

maybe you need to put “end” once and change if canJump == false then to elseif canJump == false then
first, put “end” under v.character:FindFirstChild(“Humanoid”).Jumppower = 0

1 Like

uh oh i think you also have to put “end” under v.Character:FindFirstChild(“Humanoid”).JumpPower = 30

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.