wait(5)
local player = game.Players.LocalPlayer
player.Character.Humanoid.WalkSpeed = 18
local keep = game.ReplicatedStorage.Electricity:Clone()
keep.Parent = player.Character.Humanoid.Torso
player.Character.Humanoid.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
local Name = game.Players:GetPlayerFromCharacter(Hit.Parent)
if Name.Name ~= player.Name then
local Backup =Name:WaitForChild("PlayerScripts").ControlScript:Clone()
Name.PlayerScripts.ControlScript:Destroy()
print("NICE")
wait(2)
Backup.Parent =Name.PlayerScripts
wait(5)
end
end
end)
So, on the "if Hit.Parent:FindFirstChild("Humanoid") then" I am getting an infinite yeild. Previously, i didn't even add find first child and it said playerscripts is not apart of player.
But obviously, playerscripts is apart of the player. What is wrong here?
Also, can i affect another player with a local scrip, such as disabling them, as done here?

2 comments
I hope you are aware that in the function where the Humanoid is being touched, the "hit" variable refers to what touched the character. For example, if you're walking on a baseplate, it will activate the function and "hit" will refer to the baseplate touching the character. Is this a script for when two humanoid come in contact?
yes i know that, thats why i have this line of code: if Hit.Parent:FindFirstChild("Humanoid") then