so i have a part that when you touch it ragdolls the player
the issue is it works for player 1 just fine but when player 2 touches the part player 1 ragdolls instead of player 2
player 1 perspective
robloxapp-20240228-1600445.wmv (1.4 MB)
player 2 perspective
robloxapp-20240228-1600561.wmv (1.9 MB)
here is the script placed in the part
-- local part = script.Parent
local RE = game.ReplicatedStorage.RemoteEvent
local players = game:GetService("Players")
local player = players.PlayerAdded:Wait()
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChildOfClass("Humanoid")
function fall(otherPart)
character = otherPart.Parent
if character:FindFirstChildOfClass("Humanoid") then
RE:FireClient(player, part)
end
end
part.Touched:Connect(fall)
and here is the connected function in starterCharacterScripts
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(player, part)
Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
wait(3)
Humanoid:ChangeState(Enum.HumanoidStateType.PlatformStanding)
end)
any help is appreciated