How can i make all the players jump using script

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local char = player.Character


script.Parent.MouseButton1Click:Connect(function(plr)
	if player.leaderstats.Cash.Value == 500 then
		player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - 500 
		print("All players are jumping for 1 min")
	end
end)

this is my script i know that i need to do server event but what will i script to make all the players jump?

1 Like

If the humanoid’s name is the default, then.

for _,p in pairs(game.Players:GetPlayers())do--Gets all players
 if p.Character then--Checks if the character exists
  p.Character:WaitForChild("Humanoid").Jump = true--Tries to find the humanoid, and if it succeeds, the character will jump.
 end
end
--Must be in a server script.
--This will make all the players jump.

Sorry if I made any mistakes, and have a nice day.

4 Likes

Do FireAllClients()
Then Create Local Script In Player Then Do OnClientEvent And player.Humanoid.Jump = true
And Make It loop (While True do)
Thanks.

1 Like

thankss broo i’m not quite good with for loops so i dont understand

but how can i alert everyone that a certain player buys the item

You can fire all clients with a remote. To fire all clients, you need a server script. You could send data to all the clients. For example: name.
You can create your own GUI, that will pop up when it happens, or you can send a notification through StarterGui:SetCore()
Here:

Have a nice day.
Edit: The StarterGui:SetCore() notification works on the client, but not on the server.
Search SendNotification in the page. You can do one notification GUI yourself, and make a localscript, that will modify it’s things. For example: Textlabel’s text.

1 Like