TextLabels don't have clicked events. You're looking for TextButtons. TextButtons have a Mouse1ButtonDown event, which you could connect to by doing this:
TextButton.Mouse1ButtonDown:Connect(function()
game.ReplicatedStorage.ClaimRemote:FireServer(TextButton)
end)
This would need to be in a LocalScript in StarterPlayerScripts.
You also need to set up a remote in ReplicatedStorage called ClaimRemote. Then, a ServerScript in ServerScriptService. Here, you would add something like:
game.ReplicatedStorage.ClaimRemote.OnServerEvent:Connect(function(plr, button)
button.Text = plr.Name
end)
This is a start, you also need to check to make sure people can't claim other people's land, and so on
Reply with further questions,
and please mark as correct if this solution works for you!
4 comments
I couldn't find a 'ServerScript'. Can you explain what that is?
Or, do you mean a module script?
A ServerScript is named "Script".
Why isn't the button working? I can't click it.