local hasroom = false
local debounce = true
local roomname = "Room"
while true do
wait()
debounce = true
local plr = game.Players.LocalPlayer
for i,v in pairs(game.Workspace.Rooms:GetChildren()) do
local ownr = v:FindFirstChild("plrowner")
if ownr then
if ownr.Value == plr.Name then
if debounce == true then
hasroom = true
debounce = false
roomname = v.Name
end
else
if debounce == true then
hasroom = false
debounce = false
end
end
end
end
if hasroom == true then
script.Parent.Text = "You're in room "..roomname
else
script.Parent.Text = "You're not in a room"
end
end
So, there are 3 hotel rooms. In each hotel room is a value with the name of the player who owns it. In this GUI I want it to say what hotel room you're in if it detects a hotel room with your name in the owner value, or to say that you're in no hotel room if there isn't a hotel room with your name in the owner value. The issue is that it doesn't work all too well. It only works if you're in room 3 (the last room), but if you're in room 1 or 2 it always says you don't have a room. Some help please?
