So..I am making a cafe. I have this script but I can't figure out how to make it so that it's for a door when you walk through. Right now it's for a GUI. Here is the code:
local Player = game:GetService("Players").LocalPlayer
--Settings--
local Uniform = {}
Uniform.Shirt = "http://roblox.com/asset/?id="
Uniform.Pants = "http://roblox.com/asset/?id="
--function--
function AddUniform(P)
local Character = P.Character
repeat wait(0) until Character ~= nil
for i,Object in next,Character:GetChildren() do
if Object:IsA("Shirt") or Object:IsA("Pants") then
Object:Destroy()
end
end
local Shirt = Instance.new("Shirt",Character) Shirt.ShirtTemplate = Uniform.Shirt local Pants = Instance.new("Pants",Character) Pants.PantsTemplate = Uniform.Pants
end
--GUIPart--
local Bin = script.Parent
if Bin:IsA("TextButton") or Bin:IsA("ImageButton") then
Bin.MouseButton1Down:connect(function()
AddUniform(Player)
end)
end
[This is NOT a request. I simply can't figure out how to change it so that it is for a door!]
