I am trying to check if my attribute CarName has no value.
What I’ve tried
if plr.Car.CarVals:GetAttribute("CarName", "") then
print("NO VALUE")
I am trying to check if my attribute CarName has no value.
What I’ve tried
if plr.Car.CarVals:GetAttribute("CarName", "") then
print("NO VALUE")
if (plr.Car.CarVals:GetAttribute("CarName") == nil or plr.Car.CarVals:GetAttribute("CarName") == "") then
print("NO VALUE")
end
if plr.Car.CarVals:GetAttribute(“CarName”) == “” then
print(“NO VALUE”)
end
Try this:
if plr.Car.CarVals:GetAttribute("CarName") and plar.Car.CarVals:GetAttribute("CarName") == "" then
print("No value.")
end
This checks if the attribute exists with the name CarName
, then checks for the value.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.