-
What do you want to achieve?
The flag to be teleported to the player’s Torso + 0,5,0 -
What is the issue?
Whenever run I get this:
Players.captan40000.Backpack.Kalmar Flag.Script:15: attempt to perform arithmetic (add) on number and Vector3
-
What solutions have you tried so far?
I can’t find any articles on adding Vector3’s together
script.Parent.Unequipped:Connect(function()
local ServerStorageService = game:GetService("ServerStorage")
local FlagTool = script.Parent
local FlagModel = FlagTool.Flag
local Player = FlagTool.Parent.Parent
repeat
task.wait()
until FlagTool.Parent.Name == "Backpack"
FlagModel.Parent = workspace
FlagTool.Parent = ServerStorageService.DroppedFlags
FlagModel:MoveTo(Player.Character.Torso.Position + 0,5,0)
for index, object in ipairs(FlagModel:GetDescendants()) do
if object:IsA("BasePart") then
object.Anchored = false
object.CanCollide = false
end
end
FlagModel.Detection.Touched:Connect(function(otherPart)
local CanContinue = true
for index, object in ipairs(FlagModel:GetDescendants()) do
if object == otherPart then
CanContinue = false
end
end
if CanContinue == true then
for index, object in ipairs(FlagModel:GetDescendants()) do
if object:IsA("BasePart") then
object.Anchored = true
object.CanCollide = false
end
end
end
end)
end)