Help with ClientSide CharacterAdded Script

So I’ve been trying to Fire a Event Client Sided with a Local Script in ReplicatedFirst and the Event isn’t firing. I’ve tried doing this Server Sided but the server can’t see these specific Children of the HumanoidRootPart or disable Humanoid States. I also don’t want to cloud my starter player scripts with these either so can someone pls help me with this.

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		print("Added")
		local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
		local Humanoid = Character:WaitForChild("Humanoid")
		
		
		--Destroy
		HumanoidRootPart:WaitForChild("Splash"):Destroy()
		HumanoidRootPart:WaitForChild("Landing"):Destroy()
		HumanoidRootPart:WaitForChild("Jumping"):Destroy() 
		HumanoidRootPart:WaitForChild("GettingUp"):Destroy() 
		HumanoidRootPart:WaitForChild("Swimming"):Destroy()
		HumanoidRootPart:WaitForChild("FreeFalling"):Destroy()
		HumanoidRootPart:WaitForChild("Climbing"):Destroy()
		
		--DisableStates
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false) 
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.Flying,false)
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics, false) 
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
		Humanoid:SetStateEnabled (Enum.HumanoidStateType.Seated, false)
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics, false) 
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
		
		--Body Movers
		local BodyAngularVelocity = Instance.new("BodyAngularVelocity",HumanoidRootPart) 
		BodyAngularVelocity.MaxTorque = Vector3.new(0,0,0) 
		local BodyVelocity = Instance.new("BodyVelocity",HumanoidRootPart)
		BodyVelocity.MaxForce = Vector3.new(0,0,0)
		
	end)
end)
2 Likes

Btw it’s not printing “Added”.

1 Like

Use a lowercase “Player” and “Character,” pretty sure it’s case sensitive!

1 Like

how come your doing it in replicated first? if its not really needed then try something like this outside of replicated first.

local Player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Humanoid = Character:WaitForChild("Humanoid")

--destroy
--disable states
--bodymovers

and @SkyWalk1n its not case sensitive, those variables can be named whatever you want them to be.

2 Likes

Because it’s one of the only places local scripts run while not being parented to the character and ill try what u have

I tried it and it didn’t work. I also have capitals in my server side CharacterAdded and PlayerAdded

you can place local scripts inside the character, PlayerGui, and PlayerScripts.

honestly i usually just place local scripts like this into playergui, i dont think ReplicatedFirst is needed for an operation thats only relevant to the player.

so try placing your local script in one of those and use the code i used above. (player added isn’t needed in local scripts either, when grabbing the local player.)

Alright ill try placing it in one of those

edit: It worked thanks :slight_smile:

epic, glad you got it figured out now.