when the player touches the block they are supposed to get the ability to NoClip for a few seconds.

I've looked at YouTube videos and threads they are all about the same and are just exploiters.

I am assuming the problem is the computer can not find a player to apply this part of the script.

I put Dashes on the top and bottom of the broken code block

Thank You


ERROR Message

Workspace.Spring.JumpPad.JumpBoost:23: attempt to index nil with 'Character'

local jump = script.Parent



local function jump_pad(otherPart)

	local hrp = otherPart.Parent:FindFirstChild('HumanoidRootPart')

	local bodyVel = hrp:FindFirstChildWhichIsA('BodyVelocity')

	if hrp and not bodyVel then
		
		local newVel = Instance.new('BodyVelocity')

		newVel.Velocity = Vector3.new(0,100,0)

		newVel.MaxForce = Vector3.new(10000,10000,10000)

		newVel.P = 5000

		newVel.Parent = hrp
		-----------------------
		Players.LocalPlayer.Character.Humanoid:ChangeState(11)
		----------------------
		
		wait(1)

		newVel:Destroy()
		
		wait(5)


	end  

end



jump.Touched:Connect(jump_pad)


7 comments

0

If this program is run through a Server-sided program, it's obvious that an attributing Player Object wouldn't exist (The Server is not a Client~). Luckily enough, the "otherPart" parameter can refer to a limb of a Character Rig, which can be referenced as otherPart.Parent.

0

Another thing to note is that at times it wont refer to a limb, which would render your HRP allocation nil. You should ensure this Instance was successfully stored before proceeding with usage; you'll get an "Attempt to index nil with 'FindFirstChild'" error at line 09 otherwise.

0

Also, by looking at the documentation for HumanoidStateType and comparing their Enums to their Values, you'll see that eleven reads:

0

StrafingNoPhysics: "Doesn't seem to be used. Cannot be set with Humanoid:ChangeState()".

0

I suggest you apply the advice I gave you in my first comment, as well as utilize CollisionGroups; this is the most appropriate way to authentically isolate the Character from Colliding with other Instances—you will not cause any misinterpretations from any used anti-exploits either.

0

I've done what you recommending for me to do in ScriptHelpers, I'm getting this new error message ChangeState is not a valid member of Model "Workspace.Kharkiiv" I replaced the Players.LocalPlayer.Character.Humanoid:ChangeState(11) to otherPart.Parent:ChangeState(Enum.HumanoidStateType.StrafingNoPhysics) I'm Russian and I'm still learning English. If you are able

0

, could you re explain what you said in script helpers but as if you are talking to a five year old. Thank You. Kharkiiv