So im trying to tween a slash attack but it isn’t working, why is this happening?
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local root = character:WaitForChild("HumanoidRootPart")
local head = character:WaitForChild("Head")
local tweenservice = game:GetService("TweenService")
game.ReplicatedStorage.Events.Effects.OnClientEvent:Connect(function(status)
if status == "Slash" then
local slash = game.ReplicatedStorage:WaitForChild("slash"):Clone()
slash.Parent = workspace
slash.CFrame = root.CFrame * CFrame.new(0,0,2) * CFrame.Angles(0,math.rad(180),0)
local goal = {}
goal.Size = Vector3.new(3.958, 0.05, 9.569)
goal.Transparency = 1
local tweentime = TweenInfo.new(1)
local tween = tweenservice:Create(slash, tweentime, goal):Play()
elseif status == "SlashSmall" then
local slash = game.ReplicatedStorage:WaitForChild("slash"):Clone()
slash.Parent = workspace
slash.CFrame = root.CFrame * CFrame.new(0,2,2) * CFrame.Angles(0,math.rad(90),0)
local goal = {}
goal.Size = Vector3.new(7.562, 0.05, 12.45)
goal.Transparency = 1
local tweentime = TweenInfo.new(1)
tweenservice:Create(slash, tweentime, goal):Play()
end
end)
I don’t think the problem is with the tween, I think it’s got to do with the CFrame. I’m not really that good in that topic, but that is where I assume the problem would be.
Yes that is now confirmed that it doesn’t make a difference and it has to be in a variable now to use the Completed event after playing the tween as stated in my recent example.
@NotZylon Did you get any errors by the way? If not, then the only real issue left is probably the CFraming needing to be tweaked a bit so it points to where you’re facing
Alright, if that’s more beneficial to you yourself then it should be no worries! If you ever have anymore issues don’t be afraid to make another post!
Although You’d just have to change the CFrame around to make it finally work, but if there’s any more underlying issues then yea probably starting over may be the better approach