Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make the :give command to everyone? (everyone can use it)

Asked by 4 years ago

I have a Hotel and I made a Hotel system and to get the card you have to say :give (username) (number of room) and it gets the card from server storage but the only problem is my receptionist cannot do the :give because they don't have admin but I don't want them to have admin because they could mess around with it and people kicked or banned for no reason. So it there some way where I can get the :give command to everyone? Or at least receptionist and up?

0
Is your game team based or group role based? DeceptiveCaster 3761 — 4y
0
I have a Hotel and I have a group for it and I don't have teams in the game but I have roles like Rank lO is manager. RadRosieee 8 — 4y
0
I don't see how that script will help I'm just trying to get the :give command for at least rank for and up. RadRosieee 8 — 4y
View all comments (6 more)
0
This isnt a request site EnzoTDZ_YT 275 — 4y
0
I know I just want to learn how to do the script. RadRosieee 8 — 4y
0
You would use GetRankInGroup to determine if a user is a "receptionist" or not. If they are then they will get the give command! DrShockz 233 — 4y
0
Ohh okay! Thank you! RadRosieee 8 — 4y
0
Just use player.Chatted event, string:split() and :Clone() ChristianTRPOC 64 — 4y
0
@DrShockz Hello! I have a quick question for your Hotel system it works good but when I unlock it it oesn't fade in/out it just stays open for like ever XD RadRosieee 8 — 4y

1 answer

Log in to vote
0
Answered by
palav 104
4 years ago
local RR = 10 --Rank requirement to use this command
local GiveCommand = ":Give" --Command to give
Players.PlayerAdded:Connect(function(Player) 
    if Player:GetRankInGroup(GroupID) >= RR then -- Checks if the player has the required rank
        Player.Chatted:Connect(function(Message) -- If so, check their chat messages.
            local LowerMessage = string.lower(Message) -- Makes it so you can say :GiVe
            if LoadCommand == string.sub(LowerMessage,1,#LoadCommand) then -- Checks if message starts with :Give
                local PlayerToGive = string.sub(LowerMessage,#LoadCommand+2, 16) -- Gets the Player

            end
        end)
    end
end)
0
Thank you so much! RadRosieee 8 — 4y
0
I have a question for it though, do I do Local Script or Script, and what do I put it in when it's done? RadRosieee 8 — 4y
0
@palav I tried the script (copied and pasted it) It didn't work maybe because I changed script name, also I did just a "Script" not "Local script" also I put my group ID in and the rank requirement. I also put the script in Server Script Service, did I do something wrong? RadRosieee 8 — 4y
0
Put it in a script in server script service, as you did. Beyond that, did you put any code after the PlayerToGive part? Right now all it does is check if the person said :Give and gets the player name palav 104 — 4y
View all comments (2 more)
0
@palav I didn't put any code after it. Was I supposed to? RadRosieee 8 — 4y
0
Yeah, right now it won't perform any visual changes. You're meant to input the code that actually give the player the pass. palav 104 — 4y
Ad

Answer this question