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

bad argument #3 (Object expected, got Vector3)?

so like my other questions i am trying to make a titan shift tool from the anime attack on titan and i am on the last part. i need the part where lightning shoots above the character and i am doing that but i cant find the characters position.

game.ReplicatedStorage.titanshifted.OnServerEvent:Connect(function(player)
	wait(3)
	local shift1 = game.ReplicatedStorage.shift1:Clone()
	local shift2 = game.ReplicatedStorage.shift2:Clone()
	shift1.Parent = game.Workspace:FindFirstChild(player.name).HumanoidRootPart.Position
end)

1 answer

✓ Accepted answer

In the code you showed above,(in line 5) you are trying to set the parent of shift1 to a position, whereas if you wanted to change the parent and the position you might use something like this:

game.ReplicatedStorage.titanshifted.OnServerEvent:Connect(function(player)
    wait(3)
    local shift1 = game.ReplicatedStorage.shift1:Clone()
    local shift2 = game.ReplicatedStorage.shift2:Clone()
    shift1.Parent = game.Workspace:FindFirstChild(player.name).HumanoidRootPart
	shift1.Position = shift1.Parent.Position
end)

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