Why is this simple script not working

why is this not working, its just an event that fires when the character dies, the script is under StarterCharacterScripts please help

local Character :Model = script.Parent
local Humanoid  :Humanoid = Character.Humanoid
local FaceTexture = "http://www.roblox.com/asset/?id=130187161010472"

local ServerScriptService = game:GetService("ServerScriptService")
local RagdollModule = require(ServerScriptService.RagdollModule)

function OnDeath()

	if not Character then return end

	print("death")
	RagdollModule.Ragdoll(Character)
	RagdollModule.BloodShit(Character.HumanoidRootPart)
	Character.Head.Decal.Texture = FaceTexture
	Character.Head.Decal.TextureContent = FaceTexture
end

Humanoid.Died:Connect(OnDeath)
1 Like

LocalScripts cannot access ServerScriptService’s contents. By the way, you are supposed to provide us with debug info like any errors/logs you see in the output window.

its not a local script im not that dumb

no errors and no prints sorry i thought i said it before

If you use a Server Script, you should not put it in StarterCharacterScripts, as it is intended for Local Scripts. Instead, it should be in ServerScriptService or in the Workspace.

1 Like

try putting a print statement right at the start of the OnDeath function.

there may be something going on with this guard clause but im too lazy to find out

1 Like

This only works in LocalScripts if it’s a player’s character.