I need help! I’m new to the world of scripting in roblox studio and don’t know how to do it, so I’m writing this post to find someone to help me with it. I mean, I do a role-playing game where players choose Plots after leaving the game (I’ve already done it) and there are houses to live on on the plots, how to do something like that when someone enters your house and you want to kick it from home / plot ? It would be best if it was a Gui / button that works only when you have your house / plot. Thank you for any help <3
We cannot directly help you with this, but we can try to guide you to the solution.
First, check if the person who is on the plot is the owner, and if they are, give them the UI that enables kicking. In that UI, they could write (or select) a name and kick the said person.
The server would then check if that person is inside the region / property. If they are, they could simply be teleported outside the house. For this, I recommend you setup an attachment or invisible part that is named something like “HouseFront” and teleport the players who got kicked there. If you want to make a blacklist system, then you can put a barrier around the house for the client as well, kind of like how Bloxburg does it.
I am kind of unsure how we could help directly in this situation. Hopefully this helped you.
Hey Batimius, Thank you,I see later if I can do it! But I have one more question how to script: scipt which if you click Ui, how would you click E from the keyboard? I mean there is a button on the interface with the inscription E and when you click it, how would you click on the keyboard ?! thank you for your help <3
Apologies for the late reply. I am not quite sure what you mean, but I made a little demo of how you could kind of make this system. The demo can be found here: Region3.rbxl (42.2 KB)
Here is the demo in action:
Now, this is by no means efficient, secure, or optimized enough. This is just a brief demo in order to understand the concept. If you were to implement this, you’d need to check if the player firing the event is ACTUALLY the owner of the plot and if so, then “kick” the player off of the plot.
I thank you for that! you are amazing. I have one more question, how can I make it work with many plots? e.g. I made Folder → Plots And there are Plots in that folder? And that there would be no problem that someone kick the owner from his plot? Thanks for any help
Whenever the owner fires the kick event, loop thru all the plots inside the folder, and using region3 detect if the part inside it has a humnoid(i.e a player) and run the Player:Kick() function.
To ensure tht a player doesnt kick the owner from his own plot, just check if the player inside the region3 isnt the actual owner.