Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to change every players in the server change walkspeed and jumppower except a specific player?

Hi im trying to make a script where a specific player can click a gui button (me) and itll freeze everyone (specifically making me sing and making them sleep) ive tried 2 methods and didnt work this took me 3 days trying to figure this out heres the script

local YuiiGui = game.Players.YuiiIsOld.PlayerGui
local Yuii = game.Workspace.YuiiIsOld
local Everyone = script.Parent
local SleepEvent = game.Workspace.SleepEvent
local FreezeEvent = game.Workspace.FreezeEvent
local StartFreeze = script.Parent.FreezeHandler
local YuiiHum = game.Workspace.YuiiIsOld.Humanoid
YuiiGui.YuiiIsOld.Frame.Sing.MouseButton1Click:Connect(function()
	YuiiGui.YuiiIsOld.Frame.Visible = false
	print("Singing!")
	script.Lullaby:Play()
	Yuii.Sing.Disabled = false
	Yuii.Animate.Disabled = true
	FreezeEvent:Play()
	StartFreeze.Disabled = false
	wait(8)
	YuiiGui.YuiiIsOld.Frame.Sing.Visible = false
	YuiiGui.YuiiIsOld.Frame.Visible = true
		script.Lullaby:Stop()
		Yuii.Sleep.Disabled = true
		Yuii.Animate.Disabled = false
		Yuii.Sing.Disabled = true
		YuiiHum.WalkSpeed = 16
	YuiiHum.JumpPower = 50
	Everyone.Sleep.Disabled = false
	Everyone.Animate.Disabled = true
	wait(5)
	Everyone.Sleep.Disabled = true
	Everyone.Animate.Disabled = false
	Everyone.FreezeHandler.Disabled = true
	Everyone.FreezeHandler:Clone()
	Everyone.FreezeHandler:Destroy()
	wait(1)
	YuiiGui.YuiiIsOld.Frame.Sing.Visible = true
end)

this is inside a local script located at StarterCharacterScripts the other script named FreezeHandler has this

	if game.Workspace.FreezeEvent.Playing == true then 
		print("Successfully Frozen")
		script.Parent.Humanoid.WalkSpeed = 0
		script.Parent.Humanoid.JumpPower = 0
	elseif game.Workspace.FreezeEvent.Playing == false then
		script.Parent.Humanoid.WalkSpeed = 16
		script.Parent.Humanoid.JumpPower = 50
	end

the animation works dont worry, the walkspeed however wont change nor the jumppower

2 answers

✓ Accepted answer

Assuming, that the code you have mentioned in LocalScript is that only, it might execute once when the player's Character is loaded.

In order to fix that, you can add a while loop to check the values constantly.

while wait() do -- Loops the code 33 times a second (in order to check constantly)
	if game.Workspace.FreezeEvent.Playing == true then 
	    print("Successfully Frozen")
	    script.Parent.Humanoid.WalkSpeed = 0
	    script.Parent.Humanoid.JumpPower = 0
	elseif game.Workspace.FreezeEvent.Playing == false then
	    script.Parent.Humanoid.WalkSpeed = 16
	    script.Parent.Humanoid.JumpPower = 50
	end
end

Lemme know if it helps!

5 comments

0

I already tried this method, except with while wait() do its while true do, it did not work

0

*It still doesnt work with while wait() do either way

0

Just check whether the value of Playing is changing

0

If it is, then try using game.Players.LocalPlayer.Character.Humanoid.WalkSpeed and all

0

Yeah that was the thing i got wrong thank you

Nvm i already fixed it i just needed to fix the humanoid part

This discussion is preserved as it was. New answers, comments, and votes are closed.