-
What do you want to achieve? Keep it simple and clear!
When the “artevent” is triggered, the “Shock” mesh will rotate. -
What is the issue? Include screenshots / videos if possible!
It does not rotate (VIDEO AND SCREENSHOT BELOW THE SCRIPT) -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried using a motor6D. I originally tried to use an animation, but moon animator does not allow you to export an animation without a rig.
My SERVERsword
script
local Tool = script.Parent
local Handle = Tool.Handle
local Anims = Tool.Anims
local plrowner = script:FindFirstAncestorWhichIsA("Player") --player holding the part
local RaycastHitbox = require(game.ServerScriptService.RaycastHitboxV4)
local Hitbox = RaycastHitbox.new(Tool.Hitbox)
local HitboxWP = RaycastHitbox.new(Tool.Hitbox2)
local TweenService = game:GetService("TweenService")
local de = false
local de2 = false
local canHit = false
local canHitWP = false
local combo = 1
config = {
Damage = 10,
AttackTime = 0.16,
Cooldown = .4
}
Hitbox.OnHit:Connect(function(hit, humanoid, raycastResult)
if canHit == false then return end
canHit = false
if humanoid.Parent ~= script.Parent.Parent and humanoid.Parent.Parrying.Value == false then
local hitPosition = raycastResult.Position
local partthing = game.ReplicatedStorage.thepart:Clone()
partthing.Parent = workspace
partthing.CFrame = CFrame.new(hitPosition)
humanoid:TakeDamage(config.Damage)
task.wait(.35)
elseif humanoid.Parent.Parrying.Value == true then
print("ouchies")
task.wait(.35)
end
canHit = true
end)
HitboxWP.OnHit:Connect(function(hit, humanoid, raycastResult)
if canHitWP == false then return end
canHitWP = false
if humanoid.Parent ~= script.Parent.Parent and humanoid.Parent.Parrying.Value == false then
humanoid:TakeDamage(15)
elseif humanoid.Parent.Parrying.Value == true then
humanoid:TakeDamage(20)
end
canHitWP = true
end)
script.Parent.Hit1.OnServerEvent:Connect(function(Player)
if de == false then
de = true
local Humanoid = Player.Character.Humanoid
local AnimationsList = Anims:GetChildren()
local load = Humanoid:LoadAnimation(Anims.Slice1)
local load2 = Humanoid:LoadAnimation(Anims.Slice2)
if combo == 1 then
load.Priority = Enum.AnimationPriority.Action4
load2:Stop()
load:Play()
combo += 1
Tool.Handle.SwordSlash:Play()
elseif combo == 2 then
load2.Priority = Enum.AnimationPriority.Action4
load:Stop()
load2:Play()
combo -= 1
Tool.Handle.SwordSlash2:Play()
end
task.wait(config.AttackTime)
Tool.Trail.Enabled = true
Player.Character.Attacking.Value = true
Hitbox:HitStart()
canHit = true
Humanoid.WalkSpeed = 10
task.wait(config.Cooldown)
Player.Character.Attacking.Value = false
Tool.Trail.Enabled = false
Humanoid.WalkSpeed = 16
Hitbox:HitStop()
canHit = false
de = false
end
end)
local tweenInfo = TweenInfo.new(
2.5, -- Time
Enum.EasingStyle.Exponential, -- EasingStyle
Enum.EasingDirection.InOut, -- EasingDirection
0, -- RepeatCount
true, -- Reverses
0 -- DelayTime
)
local shocktween = TweenService:Create(Tool.Shock, tweenInfo, {CFrame = Tool.ShockTween.CFrame})
script.Parent.artevent.OnServerEvent:Connect(function(Player)
if de2 == false then
de2 = true
local Humanoid = Player.Character.Humanoid
local AnimationsList = Anims:GetChildren()
local load = Humanoid:LoadAnimation(Anims.WEAPONARTthrust)
load.Priority = Enum.AnimationPriority.Action4
load:Play()
Tool.Handle.SwordSlash:Play()
task.wait(0.1)
Tool.Shock.Transparency = 0
shocktween:Play() -- play the tween
HitboxWP:HitStart()
Player.Character.Attacking.Value = true
canHitWP = true
game.ReplicatedStorage.weaponarttimer:FireClient(Player)
task.wait(1)
Tool.Shock.Transparency = 1
HitboxWP:HitStop()
Tool.Trail.Enabled = false
Player.Character.Attacking.Value = false
task.wait(4)
Humanoid.WalkSpeed = 16
canHitWP = false
de2 = false
end
end)
The explorer tab:
A video of it not working:
robloxapp-20240109-2326186.wmv (2.0 MB)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.