So like I am making an RPG using a kit from Evercyan and tried to make a mob with custom attacks. When I used this code on a mob it just bugs out.
local humanoid = script.Parent.Enemy local gui = script.Parent.Enemy:WaitForChild('WarningGui') function tween() local tS = game:GetService("TweenService") local part = script.Parent.Sword local arm = script.Parent["Right Arm"] local tweenInfo = TweenInfo.new(0.45, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false) local properties = { Orientation = Vector3.new(-67.5, -90, -90) } local armProperties = { Orientation = Vector3.new(67.5, 90, 0) } local reverseProperties = { Orientation = Vector3.new(-90, -180, 0) } local reverseArmProperties = { Orientation = Vector3.new(90, 90, 0) } local createTween = tS:Create(part, tweenInfo, properties) local createArmTween = tS:Create(arm, tweenInfo, armProperties) createArmTween:Play() wait(1) local createReverseArmTween = tS:Create(arm, tweenInfo, reverseArmProperties) local createReverseTween = tS:Create(part, tweenInfo, reverseProperties) createReverseArmTween:Play() end while true do wait(4.5) repeat wait() until script.Parent.isFollowing.Value == true gui.Enabled = true wait(0.45) gui.Enabled = false tween() script.Parent.Sword.fireDamage.Disabled = false wait(0.6) script.Parent.Sword.fireDamage.Disabled = true end