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

Give people a shirt,pants and hat as soon as they join a game?

Asked by 10 years ago

So how would I do this? If you could provide me the full script that would be great.

2 answers

Log in to vote
1
Answered by 10 years ago

All characters have Shirts and Pants inside them, unless they are using a package like me.

Click for the Character

We can set their textures using -

Shirt Template and Pants Template

So, therefore, this script will work.

local shirtemplate = "id here"
local pantstemplate = "id here"
local hats = {"hat 1 id","hat 2 id","hat 3 id","even a hat 4 id"}

function giveShirtAndPants(p)
    local c = p.Character
    c.Shirt.ShirtTemplate = shirtemplate
    c.Pants.PantsTemplate = shirtemplate
    for _,v in pairs(hats) do
        local hat = game:GetService("InsertService"):LoadAsset(v).Parent = c
    end
end

game.Players.PlayerAdded:connect(function(p)
    repeat wait() until p ~= nil
    repeat wait() until p.Character ~= nil
    giveShirtAndPants(p)
    p.CharacterAdded:connect(function(c)
        repeat wait() until c ~= nil
        giveShirtAndPants(p)
    end)
end)
0
What about the hat? RFYassine 15 — 10y
0
Sorry, let me edit that into the script YaYaBinks3 110 — 10y
0
Try that, not sure if the hat bit will work yet :p YaYaBinks3 110 — 10y
Ad
Log in to vote
0
Answered by
Uroxus 350 Moderation Voter
10 years ago

You could do this without a script, Just a morph. Make the morph of what you want people to look like and make it transparent and have a spawn point under it. So they get the clothes, hats exc and spawn where they want with no complex scripting.

Answer this question