So within the past 30 minutes, I’ve gone through the developer website and went through the scripting articles.
Let’s say I have an admin panel. When the user clicks the “ban” “kick” or “warn” button, it’s gonna send it from client to the server then back to the client. When I was looking through the articles, they didn’t have anything covering webhooks. So I’m curious about getting some help within this area.
And one more thing that’s not relevant to webhooks, is there a library or something that’s full of all possible variables (like onTouch, or even GetRankInGroup)?
If you are looking at making a universe moderation system then a datastore will work for your needs. If you are looking for a global moderation system then you would have to use third party system to store the data.
I would just google them which would either give you the code or the Roblox api page.
And to answer your question about for example GetRankInGroup and “onTouch”, you need to do it on a certain item. “onTouch” is also called Touched which you can use on a for example Part.
GetRankInGroup can be done by getting the Player object, for example this would give us the rank in a local script:
local Player = game.Players.LocalPlayer -- gets the player object
print(Player:GetRankInGroup(--groupid))
The code above will print the RankId that the Player has in the group which you can change by changing the group id.
For when a part is touched you can do the following:
local Part = game.Workspace.Part -- change Part to whatever your Part is called
Part.Touched:Connect(function(Touch) -- once the part is touched it will do the following
if Touch.Parent:FindFirstChild("Humanoid") then -- we're checking if it's a player touching the part by checking for a Humanoid object
print(Touch.Parent.Name .. " touched the part!") -- will print "Username touched the part"
end
end)
The Touched event (for parts) must be used in a normal Script as it will not work in a local one. Hope this helped!
Your post mentions webhook frequently but never explains what you’re talking about. What do you mean by webhooks? I would assume you’re talking about Discord but I can’t just freely assume that because the term webhook doesn’t just refer to Discord webhooks.
Creating webhooks is completely up to your own case and depends on what platform or external server you’re using, so of course they wouldn’t include details on webhooks. They’re case dependent. You’ll often find tutorials for webhook setup on a platform’s developer portals or tutorials on how to create one for your server on the internet.
onTouch does not exist, that’s Touched which is a method (NOT a variable) of the BasePart class. GetRankInGroup is in the same boat, it’s a method of the Player class and not a variable. Variables are things you define in your code to hold references to something. All of this can be found on respective API pages on the Developer Hub. Check out the API Reference as well as the sidebar. There is also a more technical API page by Anaminus.
Again, you say webhook but it’s not clear what you’re referring to. What exactly are you talking about? What webhook? Are you trying to send out an Http request to an external server or are you trying to use a platform’s webhook? Please specify. We’ve been trying to get that explanation from you.
To discord. Let’s say a user hits a text button. How would I set it up so I get a response in a discord webhook in my server that would show the name of the user.
That’s more like it! Remember to explain things that you think may not be immediately clear. Webhooks don’t just mean Discord webhooks.
That being said, there is an overabundance of resources in the catalog and examples you can salvage on the DevForum considering there are a lot of developers who (mis)use Discord webhooks. Search any thread honestly and you’ll have a good example.
You can get an example of using webhooks simply by looking at previous support topics on them (provided you also apply solutions if the code is broken). One such example I found by searching for less than a few 10 seconds: