Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
3wdo 198
4 years ago

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

Log in to vote
1
Answered by 4 years ago

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)
Ad

Answer this question