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

Model isnt moving up when script is activated?

Asked by 3 years ago

There is an error on line 10 telling me I cant double vector3??

local part = script.Parent

local function onPartTouched(otherPart)
    local partParent = otherPart.Parent
    local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
    if humanoid then
        game.Workspace.tricky.Playing = true
        wait(9.1)
        game.Workspace.tricky.Playing = false
        game.Workspace.Clown:MoveTo(-159.244, 1.809, -30.002)
        humanoid.Health = 0
        wait(4)
        game.Workspace.Clown:MoveTo(-159.244, -4.801, -30.002)
    end
end

part.Touched:Connect(onPartTouched)

Im trying to move Model Clown up so it "kills" the player

1 answer

Log in to vote
1
Answered by
RAFA1608 543 Moderation Voter
3 years ago
Edited 3 years ago

Hello!

There is a difference between tuples and Vector3s.

This is a tuple:

local a,b,c = -159.244, 1.809, -30.002 

and this is a Vector3:

local v3 = Vector3.new(-159.244, 1.809, -30.002)

Therefore, we can conclude that: tuple =/= Vector3

Vector3s are used to measure size and position. Tuples can be used as vector3s, but most commonly, they are not used to measure size and position.

To fix your script, put your coordinates inside Vector3.new(), like this:

game.Workspace.Clown:MoveTo(Vector3.new(-159.244, 1.809, -30.002))

If you have any questions, you can ask them in the comment section below.

Ad

Answer this question