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

Clone helmet to player position?

Asked by 8 years ago

Hey guys!

I have this script where I need the helmet to clone from the ServerStorage to the player. I don't know how to do so however. Anyone got any ideas?

script.Parent.MouseButton1Down:connect(function()
playername = script.Parent.Parent.Parent.Parent.Name
playerteam = script.Parent.Parent.Parent.Parent
player = Workspace:FindFirstChild(""..playername.."")
if player ~= nil then
    player:FindFirstChild("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=267460168" 
    player:FindFirstChild("Pants").PantsTemplate = "http://www.roblox.com/asset/?id=267460509"
    wait(1)
    game.ServerStorage.BlueHelmet:Clone().player.head --I have no idea what to do here
end
end)

This is inside a Local Script, so if I need a separate script to do this, let me know!

Cheers,

Michael

2 answers

Log in to vote
1
Answered by
funyun 958 Moderation Voter
8 years ago

You can use a variable to index clones and new instances.

local helmet = game.ServerStorage.BlueHelmet:Clone()
helmet.Parent = player
0
Thanks! Now my racers have helmets! :3 Michael007800 144 — 8y
Ad
Log in to vote
0
Answered by
iKobi 0
8 years ago

I'm confused on what your trying to say, but if you want to move the hat to the right position, maybe this would work: ... BlueHelmet:MoveTo(Player.Character.Head.Position)

0
I need it cloned from ServerStorage first. Michael007800 144 — 8y

Answer this question