Hey Folks, I’m working on a vehicle spawning system and I have a check that checks a StringValue named SelectedItem
and it is set to nil. However, in one of the if statements checking if this value isn’t value, it passes through (meaning it’s not nil) and in the server-side of my RemoteFunction, it’s returning the value “is”. Any solutions?
Photos/Code
local check = false
if selectedItem.Value ~= nil then
check = intiatePurchase:InvokeServer(selectedItem.Value)
else
warn('No Vehicle Selected!')
end
If statement checking if value is nil or not.
local priceOfVehicle = shopAssets[vehicleName].VehicleSettings.CreditsRequired.Value
if player.leaderstats.Credits.Value >= priceOfVehicle then
player.leaderstats.Credits.Value = player.leaderstats.Credits.Value - priceOfVehicle
print(vehicleName .. 'spawned!')
return true
else
return false
end
end
Remote Function
SelectedItem StringValue
StringValue set to nil
Error (In Output)
Thanks for checking!
Queued