script.Parent.MouseButton1Down:connect(function()
p = game.Players:FindFirstChild(script.Parent.Parent.Name.Text)
for i,v in pairs(game.Players:GetPlayers()) do
c = v.Backpack:FindFirstChild('Room'..script.Parent.Parent.RoomNum.Text)
if c then
script.Parent.Text = "Room Taken!"
script.Parent.TextColor3 = Color3.new(255,0,0)
wait(3)
script.Parent.Text = "Give Player Room Key (Must Be Full Name)"
script.Parent.TextColor3 = Color3.new(0,255,0)
else
key = game.ServerStorage.Room101:Clone()
key.Name = "Room"..script.Parent.Parent.RoomNum.Text
key.Parent = p.Backpack
end
end
end)
Moderator note: Please use Lua code blocks for lua code, and format your code before posting.
