and i try to get the hit humanoid so that it can play the fall animation, the animation itself simply doesnt show for everyone., so far i understood that im finding the humanoid hit on client side, so i was wondering if i can find it on server script always using the touch event on the local script
local Part = script.Parent
local Animation = ???
local TouchDebounce = {}
Part.Touched:Connect(function(hit)
if (hit.Name == "Right Arm") then
local Player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
local Character = Player.Character
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
if Humanoid and not table.find(TouchDebounce, Player.Name) then
table.insert(TouchDebounce, Player.Name)
local Animator = Humanoid:FindFirstChildOfClass("Animator")
if Animator then
local AnimTrack = Animator:LoadAnimation(Animation)
AnimTrack:Play()
task.wait(0.5)
table.remove(TouchDebounce, table.find(TouchDebounce, Player.Name))
end
end
end
end)
i mean if the player character hits another humanoid then it will play the other character animation, to be more specific ima go with an example, lets say u push a player, if ur arms touches the humanoid of that player, then that player will play a falling animation after being pushed
you can’t play an animation on another player from your client and have it render to everyone else, when you detect a hit, fire a remote even to the server and have it run the logic there. animations ran on yourself and on the server replicates to other people, but me running an animation on someone else will only replicate to myself only.
FallFEvent.OnServerEvent:Connect(function(plr, Target)
if Target:FindFirstChild("Torso") and plr.Character:FindFirstChild("Torso") then
local Distance = (plr.Character.Torso.Position - Target.Torso.Position).Magnitude
if Distance <= 10 then
local anim = Instance.new('Animation')
anim.AnimationId = 'rbxassetid://12292337201'
local Anim1 = Target:WaitForChild("Humanoid").Animator:LoadAnimation(anim)
Anim1:Play()
Target:WaitForChild("Humanoid").WalkSpeed = 0
wait(1)
Target:WaitForChild("Humanoid").WalkSpeed = 20
end
end
end)
and then when i detect the hit i fired the server:
Player.Character["Right Arm"].Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
game.ReplicatedStorage.FallFEvent:FireServer(hit.Parent)
end
end)
the next step is to debug, put prints at every position it could break, every if statement and see where it stops. it could be a logical error where an if statement isn’t completed etc.
so i puted prints at every statement i did in the remote event and i put even in the local script when i fire the server, in the local script it prints perfectly fine, it detects the humanoid hitted and that the remote event fire’s the server, but i dont get any prints on the output of the remote event
may i see where you put prints in the server? if the remote event doesn’t even detect anything being fired it may be that the script that contains the connection may not be functional as a whole, being disabled or an error earlier doesn’t connect the function to the event