ServerScript using Seat Error

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'  ```

Are these values? What are you trying to get here. If your trying to get the Characters head, then It should be
Seat.Occupant.Parent:FindFirstChild("Head"):FindFirstChild("face")

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.