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

Unable to cast double to Vector3? :MoveTo() function breaking?

I have 4 Teams in my game which all contain a Vector3Value and when a player is assigned to a team, I want a Model to teleport to a place. Here is my code:

game.Players.PlayerAdded:Connect(function(Player)

	repeat wait() until Player.Team ~= nil

	local ModelPos = Player.Team.Value -- (the vector3value i was talking about b4)
	local Model = workspace.Model

	Model:MoveTo(ModelPos)

end)

The model has a primary part btw

Whenever the script runs the output says "Unable to cast double to Vector3".

anyone help?

1 comment

0

Are you sure you link the Vector3 right, and is that even a Vector3Value because it said it is a Double.

1 answer

game.Players.PlayerAdded:Connect(function(Player)

    repeat wait() until Player.Team ~= nil

    local ModelPos = Player.Team.Value -- (the vector3value i was talking about b4)
    local Model = workspace.Model

    Model:MoveTo(ModelPos)

end)

local ModelPos = Player.Team.Value -- (the vector3value i was talking about b4)

IM SO DUMB it was the common case where you forget to reference the actual property "Value" of a thing thats called Value. doesnt explain output though

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