This part of my code is working fine in Roblox Studio (with the rest of the script), but in game mode this part of code is working different, the hat is being cloned into the player but not worn, but on the ground...
What could I do to fix it?
local hat = game.Lighting.Hats.KnightHat:Clone() hat.Parent = player.Character
Making a Hat a child of Character
won't help as much when playing in the server, You have to set the Hat's handle's CFrame.
hat.Handle.CFrame = char.Head.CFrame * CFrame.new(0, char.Head.Size.Y / 2, 0) * hat.AttachmentPoint:inverse() -- this basically places the hat on the player.