A script that prevents a player to sit on a seat unless the player has a certain tool in inventory

I know how to script a bit but not in this scale… so let me explain

I have an airline in roblox and we have this new “Business Class” ticket that is a tool. I want to make a script that allows the player to sit on a business class seat only if they have the ticket tool.

1 Like

Alright this is pretty simple to do using collection service. You’ll give a tag to every seat called “bc” short for business class. Then you’ll make sure all the seats are disabled this way nobody can sit on it.

– On the client
Then when a player gets a ticket and depending on the ticket you’ll loop through all the tags of “bc” or whatever you want to name it and undisable the seats according to their ticket allowing them to sit on it. – This will be on the client btw

and if you’re removing a ticket you can then loop through all the seats again and redisable them on the client.

you can even do this semi automatically by naming the tag “bc” and then giving the ticket an attribute called “class” with the string “bc”. so now all you do is make the collection service loop through all tags with the class string under the ticket. Since you might be doing more than one type of ticket and you wouldn’t want to repeat it the collection service loop multiple times.

2 Likes