I’m trying to clone a particle to a players head when they sit in a chair and this is what I have so far but it doesn’t work. (this has to be a server script)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GameDataModule = require(ReplicatedStorage.Modules.GameDataModule)
local Seat = game.Workspace.Workspace.Cafe.Decorations.Comfort.Chairs._Chair.Seat
Seat.Changed:Connect(function(Properties)
if Seat.Occupant ~= nil then
--sitting
local Player = game.Players:GetPlayerFromCharacter(Seat.Occupant.Parent)
local Face = Player:FindFirstChild("Head"):FindFirstChild("face") --error
game.Players[Player]:SetAttribute("Face", Face.Texture)
Face.Texture = "http://www.roblox.com/asset/?id="..GameDataModule.SleepyFaceID
game.ReplicatedStorage.GameContent.Zs:Clone().Parent = Player:FindFirstChild("Head")
elseif Properties == "Occupant" and Seat.Occupant == nil then
--not sitting
end
end)
ServerScriptService.SleepyHandler:8: attempt to index nil with 'FindFirstChild' ```