Discord roles for permissions (im creative, i know)

I did say it was a stupid question but I might replace that with this. :rofl:

There we go, i fixed the issue with the system, for some reason, it just randomly decided to happen to me, so now i actually know what the issue was.

have fun role-ing

Please let me know if you still experience any other issues, @FREAK and @sycho56

It’s now functional with the latest server build, thank you!

Though I am still having my initial problems getting the export to work. Would this be something wrong with this script or something wrong with the script I’m trying to write? Any information will help.

Without seeing any code, i cannot say specifically.

1 Like

I’m sure I’m asking a lot but could you give me a short bit of example code that will, maybe just say something in chat if I have a certain role? If that works I think I can figure it out from there

RegisterCommand("amispecial", function(source,args,raw)
	local hasPerms = exports.discord_perms:IsRolePresent(source, "admin")
	TriggerClientEvent("chat:addMessage", source, { args = {"", "You are "..(hasPerms and "" or "not").." special because you have the admin role in discord!"} })
end, false)

and in config.lua, ensure that you have something like:

Roles = {
    ["admin"] = "RoleIdHere"
}

Untested, but should work

I will give it a test when I get home and let have know if I have issues from there. Thank you very much, you’ve exceeded my expectations in helpfulness.

Thanks that was wat i asked about

1 Like

Okay, i get your point, no need to post it twice.

Just tested it now, and it worked here, so, let me know if you have any issues :slight_smile:

Is there any way to use this with RolesFX so if somone have donator rank on the discord the get it on the server?

Great release!

Anyone know why it returns only {“code”: 0, “message”: “401: Unauthorized”} instead of my server roles ?
Bot have all permissions.

2 Likes

You sure the token and guild I’d is Correct? There’s no other way you should get that error

Ok so It’s more than possible I am a retard but, can the role nickname have a [space] in it since it is in quotation “”? Also would I be able to hook this into a “chat role” system in-game?

Also how do the “permission thingies” work? Could I have it to replace ACE permissions?

I might make a system for it to work with aces, but right now you can simple have an if statement, and yes, your role nickname can be whatever you wish and yes for chat system, might make an example for that

1 Like

So would this code work, im very new to scripting

Config = {
	DiscordToken = "NTMxOTI2NTI3MTM1NDQ-----------------------------",
	GuildId = "470245542996475906",

	-- Format: ["Role Nickname"] = "Role ID" You can get role id by doing \@RoleName
	Roles = {
		["Founder"] = "♔ Offical Founder of LADPS ♔ " -- This would be checked by doing exports.discord_perms:IsRolePresent(user, "TestRole")
		["Owner"] = "Server Owner"
	}
}

In Role you have to add role id, not role name.
Use @rolename, send and then right click and copy id.
@sadboilogan Yeaim sure GUILD and token are correct.

Just edited your code to remove the token, you probably want to regenerate that token, as it could be used to take over your Didcotd bot

I saw, why I changed it quick