Getting Started

To get started, open a baseplate from ROBLOX, and add a model (by clicking on the plus that appears when you hover over the workspace.)
Now Inside that, add:

Now that is done, we can focus on some scripting... almost.
Just add a ClickDetector and a Script to the base's baseplate.
Now we can start scripting.

This will be the code you should add.

local function onClick(player)
if script.Parent.User.Value == '_' then
script.Parent.User.Value == player.Name
script.Parent.ClickDetector:Destroy()
end
end
script.Parent.ClickDetector.MouseClick:Connect(onClick)

To test if this works, walk up to the base, and click it. If the following happens, its working.

What in the world is happening???

Let us have a look at the code a line at a time.

  1. local function onClick(player) This is making a function, using the variable player. Player is the person who clicked the part.
  2. if script.Parent.User.Value == '_' then Remember the string value you made earlier? this is checking if it is still '_'
  3. script.Parent.User.Value == player.Name This is setting the string value to the player's name, as the player is who clicked the part.
  4. script.Parent.ClickDetector:Destroy This is destroying the ClickDetector. What else would it do?
  5. end end These ends mean the end to the function and the if statement started earlier.
  6. script.Parent.ClickDetector.MouseClick:Connect(onClick) This is now letting the computer make the connection that is: "If this part is clicked, do the onClick function."