-
What do you want to achieve?
I’ll I’m trying to do is access the players Folders known as (CarsOwnedFolder) not to edit, but only to be used to check if player owns said item as what the code will do is this.
If the value is inside the folder (CarNamed) is equal to the (CarNameValue) inside a button then the player owns the car
-
What is the issue? Include
So close to getting this working, it’s just (trouble-sum) of trying to access the players folder using a normal script.
You might say, why aren’t you using a (Local-Script), that’s because my script works fine as it displays the info about the cars name, it’s price, and image. So if I switch it to a (Local-Script), it just leaves everything blank and errors out certain parts of the code.
-
What solutions have you tried so far?
None of the other post actually helped as they have different needs in different situation.
local CarNameValue = script.Parent.Parent.Parent.Parent.Parent.Vehicle_Info.Side_Info
local CarNameValue2 = script.Parent.Parent.Parent.Parent.Parent.Vehicle_Info
local Vehicle_Info_Values_Folder = script.Parent.Parent.Vehicle_Info_Values_Folder
local VehicleSpawnName = script.Parent.Vehicle_Spawn_Name
local FakeVehicleName = script.Parent.Fake_Vehicle_Name
local BBN = Vehicle_Info_Values_Folder.Build_By
local Built_by = CarNameValue.Built_By
local CarYear = Vehicle_Info_Values_Folder.Year
local CarOrigin = Vehicle_Info_Values_Folder.Origin
local CarClass = Vehicle_Info_Values_Folder.Class
local CarColor = Vehicle_Info_Values_Folder.Car_Color
local Vehicle_Image = script.Parent.Parent.Car_Image
local HasVariant = script.Parent.HasVariant
local HasTrailer = script.Parent.HasTrailer
local VAR_Text = CarNameValue2.Bottom.Variant_Check
local TRLR_Text = CarNameValue2.Bottom.Trailer_Check
local DVF = script.Parent.Parent.Parent.Parent.Parent
--local CarMoneyValue = game.ServerStorage.Cars:FindFirstChild(VehicleSpawnName.Value):FindFirstChild("PriceLineValue")
--Buy Car info
local BuyInfo = script.Parent.Parent.Parent.Parent.Parent.Vehicle_Info.Buy_Info
local FindCar = game.ServerStorage.Cars
local Naming = script.Parent.Vehicle_Spawn_Name
local Goal = FindCar:FindFirstChild(Naming.Value)
script.Parent.MouseButton1Click:Connect(function(Plr)
local CarsOwnedFolder = Plr:FindFirstChild("CarsOwnedFolder")
print(CarsOwnedFolder)--Right here if your reading this on the forums <<<<<<<<
if Naming.Value == CarsOwnedFolder then--Need to buy the car
CarNameValue.BuyCars_Button.Visible = true
CarNameValue.Parent.Buy_Info.BuyIt.Visible = true
CarNameValue.Parent.Buy_Info.DontBuy.Visible = true
CarNameValue.Parent.Buy_Info.TextLabel.Visible = true
CarNameValue.Parent.Buy_Info.OwnedCar.Visible = false
CarNameValue.Spawn_Button.Visible = false
else--You own the car
CarNameValue.BuyCars_Button.Visible = false
CarNameValue.Parent.Buy_Info.BuyIt.Visible = false
CarNameValue.Parent.Buy_Info.DontBuy.Visible = false
CarNameValue.Parent.Buy_Info.TextLabel.Visible = false
CarNameValue.Parent.Buy_Info.OwnedCar.Visible = true
CarNameValue.Spawn_Button.Visible = true
end
BuyInfo.InfoFrame.CarText.Text = ("Car: "..script.Parent.Fake_Vehicle_Name.Value)
BuyInfo.InfoFrame.PriceText.Text = ("Price: $"..Goal:FindFirstChild("PriceLineValue").Value)
BuyInfo.InfoFrame.YearText.Text = ("Year: "..script.Parent.Parent.Vehicle_Info_Values_Folder.Year.Value)
BuyInfo.BuyIt.BuyCarsScript.PriceTagValue.Value = Goal:FindFirstChild("PriceLineValue").Value
BuyInfo.BuyIt.BuyCarsScript.CarNameValue.Value = Goal.Name
BuyInfo.Parent.Side_Info.Price_Text.Text = ("Price: $"..Goal:FindFirstChild("PriceLineValue").Value)
CarNameValue.Spawn_Button.Spawn_Car_Name.Value = (VehicleSpawnName.Value)
CarNameValue.CarName_Text.Text = (FakeVehicleName.Value)
CarNameValue.Vehicle_Image.Image = (Vehicle_Image.Image)
Built_by.Text = ("Built By: "..BBN.Value)
CarNameValue.Built_By.NamesValue.Value = (BBN.Value)
CarNameValue2.Bottom.Year_Label.Text = ("Year: "..CarYear.Value)
CarNameValue2.Bottom.Origin_Label.Text = ("Origin: "..CarOrigin.Value)
CarNameValue2.Bottom.Class_Label.Text = ("Class: "..CarClass.Value)
CarNameValue2.Bottom.Color_Label.Text = ("Color: "..CarColor.Value.Name)
if HasVariant.Value == true then
VAR_Text.Text = "VAR: Yes"
else
VAR_Text.Text = "VAR: No"
end
if HasTrailer.Value == true then
TRLR_Text.Text = "TRLR: Yes"
else
TRLR_Text.Text = "TRLR: No"
end
if DVF:FindFirstChild("DifferentVersions_Frame") then
DVF.DifferentVersions_Frame.CloseButton.OG_VehicleName.Value = VehicleSpawnName.Value
end
end)
Do not write entire scripts or design entire systems.

