So i’m firing a remote event and it won’t fire. Idk why, heres the two scripts
Local Script
local character = game.Players.LocalPlayer.Character
local Player = game.Players:GetPlayerFromCharacter(character)
local hum = character:WaitForChild("Humanoid")
hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
hum.HealthChanged:Connect(function(health)
if health <= 0 then
game.ReplicatedStorage.Ragdoll.PlayerDied:FireServer()
print("Hello")
end
end)
ServerScript
script.Parent.PlayerDied.OnServerEvent:Connect(function(Player)
local Char = Player.Character
print("Fired")
for i, v in pairs(Char:GetDescendants()) do
if v:IsA("Motor6D") then
print("IsA")
local Socket = Instance.new("BallSocketConstraint")
local Attachment = Instance.new("Attachment")
local Attachment2 = Instance.new("Attachment")
Attachment.Parent = v.Part0
Attachment2.Parent = v.Part1
Socket.Parent = v.Parent
Socket.Attachment0 = Attachment
Socket.Attachment1 = Attachment2
Attachment.CFrame = v.C0
Attachment2.CFrame = v.C1
Socket.LimitsEnabled = true
Socket.TwistLimitsEnabled = true
v:Destroy()
end
end
end)