Car Spawn System Error

Hey. I am making a car system where I click a button in a menu and it fires a server, and then the car is supposed to spawn!

However, I have modified a script in the area objects to tell whether or not there is something obstructing the spawn point, and the script basically looks like this:

script.Parent.Touched:Connect(function(hit)
	script.Parent.boolValue = true
end)

script.Parent.TouchEnded:Connect(function(hit)
	script.Parent.boolValue = false
end)

And I have verified there is indeed a boolValue called boolValue under the Area1 object, however the output tells me there isn’t, even tho I am literally seing it right there!
image

I might be missing something, let me know!

Dunno why that image didn’t load.

why you using bool value for spawn the car?

Just make a variable instead of a bool value

local canSpawn = false -- or true, depends how you do it
script.Parent.Touched:Connect(function(hit)
	canSpawn = true
end)

script.Parent.TouchEnded:Connect(function(hit)
	canSpawn = false
end)

I figured it out.
It was a simple mistake in the code, actual object values in the explor have an extra little thingy, so like i did boolValue = false, I had to do boolValue.Value = false (bad explaining ik)

However, thanks for replyin to my topic!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.