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

5 comments
Try making it a local script...
Is this a LocalScript? Is FilteringEnabled set to true?
It is already a local script, I don't know what's FilteringEnabled
Try "local hat = game.Lighting:WaitForChild("Hats"):WaitForChild("KnightHat"):Clone()"
Tried FilteringEnabled set to true (idk why) but it got even worse in game, Tried also changing that line of code but still works perfect in Roblox Studio but not in game mode. :/