Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make this locate a players head?

Asked by 10 years ago
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

1 answer

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

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)

0
Thanks for the support. Shawnyg 4330 — 10y
Ad

Answer this question