I Basically need help on how to script a few things. 1st, if the player leaves the game the text will reset back to the original. 2nd, a script only allowing a player to claim one dorm at a time and is unable from trying to claim a claimed dorm (they are still able to claim a unclaimed dorm, it would just unclaim there last dorm Allowing others to claim). 3rd, if a player already has claimed a dorm, it doesn't continue to give them a key when the button is clicked.
local p = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
if p.Backpack:FindFirstChild("Key")or p.StarterGear:FindFirstChild("Key")or
game.Workspace[p.Name]:FindFirstChild("Key")then
script.Parent.Text = "Dorm Claimed"
wait(1)
script.Parent.Text = p.Name
else
local tool = game.ServerStorage.Key:Clone()
tool.Parent = p.Backpack
script.Parent.Text = p.Name
end
end)

3 comments
okay, im gonna play with these scripts, ill let you know what happens
okay for the second, can you explain a little bit more. if you'll like i'll set up team create. its up to you
so make a folder put it in workspace put some string values in there, whenever someone gets a dorm have the script change one of the strings to the players name if they don't already have one