local passId = 161403364
function isAuthenticated(player)
return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
game.Players.PlayerAdded:connect(function(plr)
if isAuthenticated(plr) then
print(plr.Name .. " has bought the game pass with id " .. passId)
end
end)
instance.new("Hat",game.Workspace.Lighting)
h = game.Workspace.Lighting.Hat
instance.new("Part",game.Workspace.Lighting.Hat)
instance.new("Mesh",game.Workspace.Lighting.Hat.Part)
h.MeshId = rbxassetid://1031429
h.TextureId = rbxassetid://1031417
local Model = game.Workspace.Lighting.Hat
while true do
local ModelCopy = Model:Clone()
ModelCopy.Parent = Workspace
end
✓ ANSWER ACCEPTED
How do I make this locate a players head?
1 answer
✓ Accepted answer
Here's your script fixed up. I'd insert a Hat Insert model into my place, Test it in Play Solo, enter the ID, pick up the hat, then bring it to Lightning and in my script, it'd just clone it and parent it. Your way should work.
local passId = 161403364
function isAuthenticated(player)
return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
if isAuthenticated(plr) then
print(plr.Name .. " has bought the game pass with id " .. passId)
Instance.new("Hat",game.Workspace.Lighting)
h = game.Workspace.Lighting.Hat
Instance.new("Part",game.Workspace.Lighting.Hat)
Instance.new("Mesh",game.Workspace.Lighting.Hat.Part)
h.MeshId = "rbxassetid://1031429"
h.TextureId = "rbxassetid://1031417"
local Model = game.Workspace.Lighting.Hat
Model.Parent = char.Head
end
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks for the support.