Hello im trying to make a spell thats similar to Viribus from rogue lineage but im facing an issue, The spell is supposed to make pillars come out of the ground infront of the player and ontop of the surface that he’s standing on but this is where the issue comes in, the pillars dont tween ontop of the surface the player is standing on and i dont know why.
this how its supposed to look:
this is how it turns out:
model:
code that tweens the pillars:
local function Cast(player, _type)
local character = player.Character
local humanoid = character.Humanoid
local root = character.HumanoidRootPart
print("~~ Called")
local playerFolder = Instance.new("Folder")
playerFolder.Name = player.Name:lower()
playerFolder.Parent = workspace.Instancefolder
print("~~ Folder Name: ", playerFolder.Name)
remote:FireClient(player, "using", {true})
_settings.Using = true
for i = 1, _settings.Server.amount_of_copies, 1 do
local clone = model:Clone()
clone:SetPrimaryPartCFrame(root.CFrame * CFrame.new(math.random(-3,3), (clone.Two.Size.Y/2)*-1,(_settings.Server.distance_between_each * i)*-1))
clone.Parent = playerFolder
debris:AddItem(clone, _settings.Server.linger+ 10)
for i,v in pairs(clone:GetChildren()) do
if v.Name ~= "Middle" then
local epic = tweenService:Create(v, tweenInfo, {CFrame = CFrame.new(v.CFrame.X, v.Size.Y/2, v.CFrame.Z)})
epic:Play()
v.Smash:Play()
coroutine.wrap(function()
repeat wait() until epic.PlaybackState == Enum.PlaybackState.Completed
print("done tweening")
wait(0.2)
v.CanTouch = false
end)()
v.Touched:Connect(function(obj)
hit(obj)
end)
end
end
wait(0.1)
end
remote:FireClient(player, "using", {false})
_settings.Using = false
repeat wait() until #playerFolder:GetChildren() == 0
workspace.Instancefolder:FindFirstChild(player.Name:lower()):Destroy()
end
any help is appreciated.