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

MeshHat Code ID problem and not sure how to import Mesh into scripts?

Asked by 4 years ago

Hello,

Im new to Roblox LUA and im struggling to understand how to put a hat mesh ID into a script.

local hat = 142283272 local players = game:GetService("Players") local team = game:GetService("Teams")

function FrenchHat(character) asset = game:GetService("InsertService"):LoadAsset(hat) give = game:GetService("InsertService"):Insert(asset) local children = asset:GetChildren() for i = 1, #children do children[i].Parent = character end end

game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(char) wait(0) local plr = game.Players:findFirstChild(char.Name) print(char.Name)

if plr.TeamColor ~= BrickColor.new("Deep blue") then return else FrenchHat(char) end end) end)

theres the code I have and the Mesh Im trying to use

https://www.roblox.com/library/4089326863/Stahlhelm2

I've tried a few methods unsuccessfully so any tips would be appreciated.

Answer this question