So I noticed that after I reset I can get the outfit again when I try to click the outfit again. Is this due to the character not being loaded fully yet? or maybe its due to something else?
function ShopClotheCamTween()
--TweenStuff
--CAMERAS
local ClotheCam1 = CameraFolder:WaitForChild("ClotheCam1")
local ClotheCam2 = CameraFolder:WaitForChild("ClotheCam2")
local ClotheCam3 = CameraFolder:WaitForChild("ClotheCam3")
--CLOTHES
local Clothes1 = ClothesFolder:WaitForChild("Clothe1")
local Clothe2 = ClothesFolder:WaitForChild("Clothe2")
local Clothe3 = ClothesFolder:WaitForChild("Clothe3")
local ClotheModel1ShirtTemplate = ClothesFolder:WaitForChild("ClotheModel1").Shirt.ShirtTemplate
local ClotheModel2ShirtTemplate = ClothesFolder:WaitForChild("ClotheModel2").Shirt.ShirtTemplate
local ClotheModel2ShirtTemplate = ClothesFolder:WaitForChild("ClotheModel3").Shirt.ShirtTemplate
local ClotheModel1PantsTemplate = ClothesFolder:WaitForChild("ClotheModel1").Pants.PantsTemplate
local ClotheModel2PantsTemplate = ClothesFolder:WaitForChild("ClotheModel2").Pants.PantsTemplate
local ClotheModel3PantsTemplate = ClothesFolder:WaitForChild("ClotheModel3").Pants.PantsTemplate
---CLICKDETECTORS
local ClickDetector1 = Instance.new("ClickDetector")
ClickDetector1.Name = "ClickDetector1"
ClickDetector1.Parent = Clothes1
local ClickDetector2 = Instance.new("ClickDetector")
ClickDetector2.Name = "ClickDetector2"
ClickDetector2.Parent = Clothe2
local ClickDetector3 = Instance.new("ClickDetector")
ClickDetector3.Name = "ClickDetector3"
ClickDetector3.Parent = Clothe3
local info = TweenInfo.new(1,Enum.EasingStyle.Sine, Enum.EasingDirection.Out,0,false,0)
local BuyGuiGoal = {Visible = true}
local BuyGuiTweenCreated = tweenservice:Create(BuyGuiFrame, info, BuyGuiGoal)
ClickDetector1.MouseClick:Connect(function(player)
stepped:Disconnect()
--Variables
local LeftClickToBuy = script.Parent:WaitForChild("BuyGui"):WaitForChild("Display"):WaitForChild("Left click to buy")
local goal = {CFrame = ClotheCam1.CFrame}
local ClotheCam1Tween = tweenservice:Create(Camera, info, goal)
-- Coding
ClotheCam1Tween:Play()
BuyGui.Enabled = true
BuyGuiTweenCreated:Play()
BuyGuiFrame:WaitForChild("Clothing Name").Text = "Firebending Robe"
BuyGuiFrame:WaitForChild("Cost").Text = "50"
LeftClickToBuy.MouseButton1Click:Connect(function()
--Need to make some CharacterAdded function
Character.Shirt.ShirtTemplate =ClotheModel1ShirtTemplate
Character.Pants.PantsTemplate = ClotheModel1PantsTemplate
--Dissconnect function
end)
end)
The code you should be looking at is at the bottom