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

(This is kinda hard to explain so read the description) :Clone() cloning things twice?

Asked by
Desmondo1 121
3 years ago
Edited 3 years ago

I'm making a mode for one of my classes in my game. I got all the effects done but for the shockwave effect, it clones itself twice and the first clone goes away but the 2nd clone stays.

Heres a video showing what it does: https://www.youtube.com/watch?v=1XrUu2flUTQ&feature=youtu.be&ab_channel=DankDesmondo

Heres my code

    local Shockwave = game.ServerStorage:WaitForChild("Shockwave"):Clone()
Shockwave.CFrame = Humrp.CFrame
Shockwave.Parent = Character

local goal = {}
goal.Size = Shockwave.Size + Vector3.new(20, 11.97, 20)
goal.Orientation = Vector3.new(0,360,0)   
local info = TweenInfo.new(2, Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
local tween = TweenService:Create(Shockwave,info,goal)
tween:Play()

local goal = {}
goal.Orientation = Shockwave.Orientation + Vector3.new(0,3600,0)
local info = TweenInfo.new(7, Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
local tween = TweenService:Create(Shockwave,info,goal)
tween:Play()


local tInfo = TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
local tween = game:GetService("TweenService"):Create(Shockwave,tInfo,{Transparency=1})
tween:Play()

wait(7)

Shockwave:Destroy()

Edit: Ok so I fixed it. Theres a REALLY weird thing happening where if you don't destroy right after it was made, this glitch happens, so basically I just needed to destroy it earlier in the code

0
Could you post the part where you clone the shockwave effect. darmantinjr 169 — 3y
0
Out of topic but- instead of doing wait(7), do tween.Completed:Wait() Sebgamingkid 147 — 3y

Answer this question