Help with Speed Modifier

Ok let me go to plan B

go into replicated storage and add in 2 remote events. Call one getSpeed and the second one loseSpeed

Then Add 2 scripts in Serverscriptservice

one will be this

local label = game.PlayerGui.ScreenGui.SpeedNumber

game.ReplicatedStorage.getSpeed.OnServerEvent:Connect(function(player)
	game.Players.PlayerAdded:Connect(function(player)
		player.CharacterAdded:Connect(function(character)
			character.Humanoid.WalkSpeed = character.Humanoid.WalkSpeed + 1
			label.Text = character.Humanoid.Walkspeed	
		end)	
	end)	
end)

Another will be this

local label = game.PlayerGui.ScreenGui.SpeedNumber

game.ReplicatedStorage.loseSpeed.OnServerEvent:Connect(function(player)
	game.Players.PlayerAdded:Connect(function(player)
		player.CharacterAdded:Connect(function(character)
			character.Humanoid.WalkSpeed = character.Humanoid.WalkSpeed - 1
			label.Text = character.Humanoid.Walkspeed	
		end)	
	end)	
end)

Then make sure you have a local script in the - button and in the + button

In the local script of the + text button do this

script.Parent.MouseButton1Click(function()

game.ReplicatedStorage.getSpeed:FireServer()

end)

then in the local script of the - button do

script.Parent.MouseButton1Click(function()

game.ReplicatedStorage.loseSpeed:FireServer()

end)

I hope this works @CompleteBroken!!

here is the model

I figured it out! But the counter isn’t working…

Script: local label =script.Parent.Parent.TextLabel

script.Parent.MouseButton1Click:Connect(function()
game.Players.LocalPlayer.character.Humanoid.WalkSpeed = game.Players.LocalPlayer.character.Humanoid.WalkSpeed +1
label.Text = game.Players.LocalPlayer.character.Humanoid.Walkspeed
end)

ok so the reason why it is not working is because

game.Players.LocalPlayer

can only be used in a local script (This is a script.) let me work on the script

change this whole script to this

local label = game.PlayerGui.ScreenGui.SpeedNumber

game.ReplicatedStorage.getSpeed.OnServerEvent:Connect(function(player)
	game.Players.PlayerAdded:Connect(function(player)
		player.CharacterAdded:Connect(function(character)
			character.Humanoid.WalkSpeed = character.Humanoid.WalkSpeed + 1
			label.Text = character.Humanoid.Walkspeed	
		end)	
	end)	
end)
1 Like

if my first one does not work try this

local label = game.PlayerGui.ScreenGui.SpeedNumber

game.ReplicatedStorage.getSpeed.OnServerEvent:Connect(function(player)
	game.Players.PlayerAdded:Connect(function(player)
		player.CharacterAdded:Connect(function(character)
			character.Humanoid.WalkSpeed += 1
			label.Text = character.Humanoid.Walkspeed	
		end)	
	end)	
end)

i gtg in a few mins but if both of the other ones don’t work then try these

local label = game.PlayerGui.ScreenGui.SpeedNumber

game.ReplicatedStorage.getSpeed.OnServerEvent:Connect(function(player)
	game.Players.PlayerAdded:Connect(function(player)
		player.CharacterAdded:Connect(function(character)
			character.Humanoid.WalkSpeed = character.Humanoid.WalkSpeed + 1
			label.Text = character.Humanoid.Walkspeed + 1	
		end)	
	end)	
end)

Then if this one :arrow_up: does not work the do this

local label = game.PlayerGui.ScreenGui.SpeedNumber

game.ReplicatedStorage.getSpeed.OnServerEvent:Connect(function(player)
	game.Players.PlayerAdded:Connect(function(player)
		player.CharacterAdded:Connect(function(character)
			character.Humanoid.WalkSpeed += 1
			label.Text = character.Humanoid.Walkspeed + 1	
		end)	
	end)	
end)

if none of these work then I am out of ideas. :sad:

That means character is not defined.

Also the script is inside the buttons, I’ll test out your script now! :sweat_smile:

1 Like