You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
(explained in topic), kind of like The Strongest Battlegrounds 20-20-20 dropkick move
What is the issue? Include screenshots / videos if possible!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i have tried using renderstepped, a repet loop a for loop and nothing worked, and i also looked for answers on developer hub but i couldnt find anything related to my topic
local func = game["RunService"].RenderStepped:Connect(function()
game.ReplicatedStorage.Remote:FireServer()
wait(.5)--Amount of time
end)
game.ReplicatedStorage.AnimRemote.OnclientEvent:Connect(function()
func:Disconnect()
end)
var = true
while task.wait(.5) and var == true do
print("Event Fired")
game.ReplicatedStorage.AnimRemote.OnClientEvent:Connect(function()
var = false
print("Stopped")
end)
end
i want it to fire a remote consistantly so that it can play like a cutscene/animation, and if you fail to hit an opponent between a time frame then stop firing the remote (basically explained in topic)
no, there was already a renderstepped function on the script that did the work for me, but when you hit the opponent, it becomes super laggy, the animation isnt played correctly and it still fires the event
I think itâd be best to fire a remote when you fail to hit rather than sending alot of them. Itâs easier on the network and scripting
remote:FireServe(true) -- true for failed
-- server
remote.OnServerEvent:Connect(function(player, failed)
-- make sure the player is doing this action
if failed then
-- failed logic
return
end
-- other logic
end)
actually, itâd be best to just check how long it takes you to fire the hit remote on the server
Make it so it plays the animation while the player is in the dropkick state. If the time ran out or the player hit another, then stop the animation and deal damage.
event.OnServerEvent:Connect(function(player, failed)
if failed == true then return end
local char = player.Character
local attackingPart = "Torso"
local hbClone = hitbox:Clone()
hbClone.Parent = workspace
local hbCFrame = char[attackingPart].CFrame
hbClone.CFrame = hbCFrame
local weld = Instance.new("WeldConstraint", hbClone)
weld.Part0 = hbClone
weld.Part1 = char[attackingPart]
local chars = {}
for _, part in pairs(GetTouchingParts(hbClone)) do
local eChar = part.Parent
if table.find(chars, eChar) == nil and eChar ~= char then
local humanoid = eChar:FindFirstChild("Humanoid")
if humanoid ~= nil then
table.insert(chars, eChar)
end
end
end
print(chars)
hbClone:Destroy()
for _, enemyChar in pairs(chars) do
local enemyHumanoid = enemyChar:FindFirstChildWhichIsA("Humanoid")
local humanoid = char:FindFirstChildWhichIsA("Humanoid")
local playingTracks = humanoid:GetPlayingAnimationTracks()
for _, track in pairs(playingTracks) do
track:Stop()
enemyHumanoid.Parent.HumanoidRootPart.Anchored = true
humanoid.Parent.HumanoidRootPart.Anchored = true
game.ReplicatedStorage.DropkickAnimRemote:FireClient(player)
enemyHumanoid.WalkSpeed = 0
humanoid.WalkSpeed = 0
local enemyAnimation = Instance.new("Animation")
enemyAnimation.AnimationId = "rbxassetid://18136825007"
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://18136827701"
local enemyTrack = enemyHumanoid:LoadAnimation(enemyAnimation)
enemyTrack:Play()
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()
animationTrack:GetMarkerReachedSignal("End"):Connect(function()
enemyHumanoid:TakeDamage(13278971839219)
end)
animationTrack:GetMarkerReachedSignal("End"):Connect(function()
humanoid.WalkSpeed = 16
humanoid.Parent.HumanoidRootPart.Anchored = false
end)
enemyTrack:GetMarkerReachedSignal("End"):Connect(function()
local motors = ragdollModule.CreateJoints(enemyChar)
ragdollModule.Ragdoll(enemyChar)
ragdollModule.SetMotorsEnabled(motors, false)
task.delay(2, function()
ragdollModule.DestroyJoints(enemyChar)
ragdollModule.SetMotorsEnabled(motors, true)
ragdollModule.UnRagdoll(enemyChar)
end)
end)
end
end
end)
i still dont understand what your trying to say because it fires only once