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

why wont the script clone move to the hand?

i have a script called hitscript and it moves anywhere but the place i want it to go

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function()
	local clone = script.punch:Clone()
	clone.Parent=player.Character:WaitForChild("Humanoid")
	local clone2 = script.hitable:Clone()
	clone2.Parent=player.Character:WaitForChild("Humanoid")
	local a = script.DummyPart.hitscript:Clone()
	a.Parent=player.Character:WaitForChild("Humanoid").Parent:WaitForChild("LeftHand")
	end)
end)

yes the script is inside dummypart yes the script moves to the Humanoid no the script dosnt move to the LeftHand yes all the code above line 8 works this is a server script

1 answer

this isn't an exact fix BUT it works the way I want inside hitscript instead of having

script.Parent.Touched:Connect(function(touchpart)

I set it to

script.Parent.Parent:WaitForChild("LeftHand").Touched:Connect(function(touchpart)

and inside the other script that moves the objects, I changed

a.Parent=player.Character:WaitForChild("Humanoid").Parent:WaitForChild("LeftHand")

to

    a.Parent=player.Character:WaitForChild("Humanoid")

this works fine and the code works

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