What I want to do is repeat the RemoteEvent until the CurrentFruit is equal to one of the Fruits in the table. How do I do that?
local fruits = {"Apple", "Orange", "Pineapple"} local eatevent = game:GetService("ReplicatedStorage").EatEvent local plr = game.Players.LocalPlayer local currentfruit = plr.Data.Fruit repeat eatevent:FireServer() until currentfruit.Value:lower() == fruits:lower()
using table.find(table,value)
so from line 6 to 9, do this:
repeat eatevent:FireServer() until table.find(fruits,currentfruit.Value)