Is anything wrong?

Hello Developers!

I don’t know whats wrong with this script!

Script:

local Check1 = script.Parent.Parent.Checkpoint1
local KillP = script.Parent

KillP.Touched:Connect(function(hit)
	
	local Players = game:GetService("Players")
	local Player = Players.LocalPlayer
	
	local Controls = Player.PlayerScripts:WaitForChild("ModuleScript"):GetControls()
	
	Controls:Disable()
	
	if hit.Parent:FindFirstChild("Humanoid") then
		local HRP = hit.Parent:WaitForChild("HumanoidRootPart")
		wait(0.2)
		HRP.Position = Check1.Position + Vector3.new(0,3,0)
	end
end)
---------------------------------------------------------------------------------------------------------
Thanks for reading!

My bad, I saw the LocalPlayer, although it is a localscript correct?
Also, your player’s controls are getting disabled whenever ANYTHING touches the KillP part.

Is this fine

local Check1 = script.Parent.Parent.Checkpoint1
local KillP = script.Parent

KillP.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		
		local Players = game:GetService("Players")
		local Player = Players.LocalPlayer

		local Controls = Player.PlayerScripts:WaitForChild("ModuleScript"):GetControls()
		
		wait(0.2)
		
		Controls:Disable()
		local HRP = hit.Parent:WaitForChild("HumanoidRootPart")
		wait(0.2)
		HRP.Position = Check1.Position + Vector3.new(0,3,0)
	end
end)

You’ll also want to check if the humanoid belongs to the player, something like
local humanoid = hit.Parent:FindFirstChild(“Humanoid”)
local character = humanoid.Parent
local foundPlayer = game.Players:GetPlayerFromCharacter(character)
if foundPlayer and foundPlayer == Player then
– stuff
end

  1. You should use hit.Parent:FindFirstChildWhichIsA("Humanoid") rather than hit.Parent:FindFirstChild("Humanoid")
  2. You should use :GetTouchingParts() on a Heartbeat event rather than .Touched (as .Touched is less accurate)
  3. You shouldn’t be handling hitboxes on the client - do this on a server script, and if you want to disable controls (I’m not sure I understand why you have disabled them) then fire a remote event.
    It appears you have put this local script in the workspace as well where it won’t run.
  4. HRP.CFrame = Check1.CFrame + Vector3.new(0,3,0) is less prone to inaccuracy from my experience than position as you have done, it will also rotate the humanoid root part