omgitspenguins
Active Member
Veteran
OmgStillAPenguin
Posts: 53
ROBLOX Username: penguins113311
|
Post by omgitspenguins on May 6, 2017 2:59:33 GMT
local plr = game.Players.LocalPlayer
local char = plr.CharacterAdded:connect(function() end)
local RightButtonHats = script.Parent.RightGui
local LeftButtonHats = script.Parent.LeftGui
local HatList
local HatCount = 0
local NewHat
local Hats = {}
plr.PlayerGui.SurfaceGui.TextButton.MouseButton1Click:connect(function()
for i,v in pairs(game.ServerStorage.Hats:GetChildren()) do
table.insert(Hats,v.Name)
HatList = game.ServerStorage.Hats:GetChildren()
end
end)
LeftButtonHats.MouseButton1Click:connect(function()
if HatCount >= #Hats then
else
HatCount = HatCount - 1
Update()
print(HatCount)
end
end)
RightButtonHats.MouseButton1Click:connect(function()
if HatCount <= #Hats then
HatCount = HatCount + 1
Update()
print(HatCount)
end
end)
function Update()
script.Parent.HatsName.Text = Hats[HatCount]
print(Hats[HatCount])
if script.Parent.HatsName.Text == Hats[HatCount] then
if HatList then
NewHat = game.ServerStorage.Hats:FindFirstChild(script.Parent.HatsName.Text):Clone()
NewHat.Parent = char
end
end
end
12:22:42.709 - Players.Player1.PlayerGui.ScreenGui.ImageLabel.HatsGui.LocalScript:41: bad argument #3 to 'Parent' (Object expected, got RBXScriptConnection) If you don't get what I'm doing I'm basically getting an accessory from a folder named hat, it knows what to grab by the FindFirstChild part but I think it's returning an RBXScriptConnection??
|
|
|
Post by cntkillme on May 6, 2017 5:20:22 GMT
local char = plr.CharacterAdded:Wait()
|
|