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

How do I add hats to my gui array? Please help.

Asked by
VVired 28
7 years ago

Well, I don't even know how to even add hats but I'm making a few arrays. All of them work, but I do not know how to make one that adds a hat to a player instantly, heres the script so far.

local array = {"80922374","32278814","13745548","105332476"} -- ids of the hats
local currentPosition = 1
local plr = game.Players.LocalPlayer.CharacterAdded:wait()

script.Parent.Right.MouseButton1Click:connect(function()
    currentPosition = currentPosition < #array and currentPosition + 1 or currentPosition
end)


script.Parent.Left.MouseButton1Click:connect(function()
    currentPosition = currentPosition > 1 and currentPosition - 1 or currentPosition
end)

0
any help? VVired 28 — 7y
0
A way to do it would be to save a bunch of hat meshes in the ServerStorage or ReplicatedStorage and just Clone them when needed. xXLegendarySoldierXx 129 — 7y
0
I see... VVired 28 — 7y

Answer this question