So I need it so that when a button is clicked it will go through a folder and if the value = the player name it will then do something. I tried this script but seems not to work and I can’t think of any other way I could do this really. By the way all of the objects inside the folder are diffrent not the same
Current server script:
RoomSignout.OnServerEvent:Connect(function(plr, plrUnknow)
local playerknown = game.Players:FindFirstChild(plrUnknow)
if playerknown then
print("Vaild user")
for i, v in pairs(game.ServerStorage.ClaimedRooms:FindFirstChild()) do
if v.Value == plrUnknow then
print("Playerbookedout")
else
print("User is not booked in yet.")
end
end
else
plr.PlayerGui.ScreenGui.SignOutSystem.Book.Text = "INVAILD USERNAME"
wait(3)
plr.PlayerGui.ScreenGui:Destroy()
end
end)
You used game.ServerStorage.ClaimedRooms:FindFirstChild() which isnt the right way to go
change that with game.ServerStorage.ClaimedRooms:GetChildren()