So i was just messing around with Tweening and such, When i click R it launches a shockwave, But when i click again it will be still Invisible, What do i do here ( the shockwave is not invisible in default), You will understand what i mean when you read the scripts
Local Script
--------------Variables----------------
local rp = game:GetService("ReplicatedStorage")
local PunchEvent = rp:WaitForChild("Punch")
local UIS = game:GetService("UserInputService")
--------------------------------------------
-------------------EventCall----------------
UIS.InputBegan:Connect(function(Input,IsTyping)
if IsTyping then
return
elseif Input.KeyCode == Enum.KeyCode.R then
PunchEvent:FireServer()
print("e")
end
end)
Server Script:
-------variables-----------
local rp = game:GetService("ReplicatedStorage")
local PunchEvent = rp:WaitForChild("Punch")
local punch = game.Workspace.Punch:Clone()
local Tween = game:GetService("TweenService")
-----------------EventCall----------
PunchEvent.OnServerEvent:Connect(function(Player)
local character = Player.Character
local HumRP = character:WaitForChild("HumanoidRootPart")
punch.Name = Player.Name.."'s Punch"
punch.Parent = character
punch.CFrame = HumRP.CFrame * CFrame.new(0,0,-3)
print("f")
local reach = {}
reach.Size = punch.Size + Vector3.new(3,3,3)
local info = TweenInfo.new(.72)
local tweens = Tween:Create(punch,info,reach)
tweens:Play()
local reach2 = {}
reach2.CFrame = punch.CFrame * CFrame.new(0,0,-77)
reach2.Transparency = punch.Transparency + (1 - punch.Transparency)
local info = TweenInfo.new(1.2,Enum.EasingStyle.Linear)
local tweenss = Tween:Create(punch,info,reach2)
tweenss:Play()
end)
What do i do here?, i've tried Destroy() with a wait(), But that reaches to a Nil Value ( i want the shockwave to be visible once the tween is over) Sorry if you did not understand, I am bad at explaining :P

1 comment
Thank you for the help!