i'm desperate please help, i'm 3 days trying to solve this

I've tried everything, but the script always leaves "Efeito2" in the wrong position, don't worry about the name of the variables, it's because I speak another language

"Efeito2" is what hasn't disappeared

Video to better understand my problem, sorry for the quality of the video:

https://drive.google.com/file/d/19FBaid38-oTafvtvRaqNkRzUD7I1jiZF/view?usp=sharing

This script is within "Effect 2":

while wait() do
script.Parent.Position = workspace:WaitForChild("LightBomb").Position
end

MainScript:

--Serviços
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

--Partes
local LightBomb = ReplicatedStorage:WaitForChild("LightBomb")

--Clones/Partes
local LightBombClone = LightBomb:Clone()
local EfeitoClonado = LightBombClone.Efeito
local Efeito2 = LightBombClone.Efeito2
EfeitoClonado.Enabled = false

--Eventos
local LightBombCriarPoderEvent = ReplicatedStorage:WaitForChild("LightBombCriarPoderEvent")

--Variaveis
local Naotocou = true
local contagem = 0

LightBombCriarPoderEvent.OnServerEvent:Connect(function(plr, mouse)
	
--Player Partes
local character = plr.Character or plr.CharacterAdded:Wait()
local Root = character.HumanoidRootPart
local Head = Root.Parent.Head
	
LightBombClone.Parent = workspace

	
local Weld = Instance.new("WeldConstraint")
LightBombClone.Anchored = true
Weld.Parent = LightBombClone
Weld.Part0 = LightBombClone
Weld.Part1 = Root

EfeitoClonado.Enabled = true
	
spawn(function()
		for x = 4,40,1 do
			wait(0.01)
			LightBombClone.Position = Head.Position + Vector3.new(0,x,0)
		end
	end)
	
spawn(function()
	for i = 1,60,1 do
		wait(0.01)
		LightBombClone.Size = Vector3.new(i,i,i)
	end	
end)
	
	wait(3)
	Weld:Destroy()
	local BV = Instance.new("BodyVelocity")
	BV.Name = "VelocidadeDoPoder"
	BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
	BV.Parent = LightBombClone
	BV.Velocity = mouse.lookVector
	LightBombClone.Anchored = false
	
	delay(3, function()
		for n = 1,25 do
			wait()
			BV.Velocity = mouse.lookVector*n
		end
	end)
	
	LightBombClone.Touched:Connect(function(QuemTocou)
		if QuemTocou.Name == "Chao" and Naotocou then
			wait(1.65)
			Efeito2.Parent = workspace
			workspace:WaitForChild("Efeito2").Script1.Disabled = false
			BV:Destroy()
			LightBombClone.Anchored = true
			character.CameraShake.Disabled = false
			Naotocou = false
			wait(7)
			for y = 0,1,0.1 do
				wait(0.1)
				LightBombClone.Transparency = y
			end
			character.CameraShake.Disabled = true
		end
	end)
end)

(Obs: every time the touched event is activated, any script gives the wrong position of LightBomb, no matter which script I try to pull the position on)

3 comments

1

Well, what is the target position supposed to be?

0

The position of "Efeito2" has to be the same position as LightBomb, which is always going wrong, if you didn't understand, I ask you to read my question again

0

the correct position is the central position of the light bomb