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

Tool Giver With Chat Voice Not Working?

Asked by 6 years ago

I could not figure out why this is not working. I was looking for it to be set up so that if a staff rank says "Give (player name) Room (Number)" it clones the tool from Replicated Storage into the player which is receiving the tool gets it in their inventory. I am not so sure on the part where the player is allocated when the message by the staff member is triggered.


local GroupID = 3248427 game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) if player:IsInGroup(GroupID) and player:GetRankInGroup(3248427) >= 5 then if message == ":give "..player.." room 101" then player.Character:GetChildren() game.ReplicatedStorage.Room101.Parent:Clone() game.ReplicatedStorage.Room101.Clone = game.Players.Character() end end end) end)

1 answer

Log in to vote
0
Answered by
Leamir 3138 Moderation Voter Community Moderator
6 years ago

Hello, Nikkasfied!

I made your script work!

Just what you need to do is to copy and understand what I did, I want you to learn roblox lua!

local GroupID = 3461088

 game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(message)
        if player:IsInGroup(GroupID) and player:GetRankInGroup(3461088) >= 252 then
            if message == ":give ".. player.Name .." room 101" then
                player.Character:GetChildren() 
                print(player.Character.Name)
                print(player.Name)
                game.ReplicatedStorage["Room101"]:Clone().Parent = game.Workspace[player.Name]
                end
            end
        end)
 end)

Good Luck with your games

0
Thank you for the advice! I will take this information into consideration. Nikkasfied 43 — 6y
Ad

Answer this question