Hey Cookie Tech!
I am working on a game, and I tried making a -pin command, but when I run the command in-game nothing happens. Below is the code, and I photo of what it should look like.
local Players = game:GetService("Players")
local prefix = "-"
local GroupId = 13185198
local MinimumRank = 5
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
if Player:GetRankInGroup(GroupId) >= MinimumRank then
Player.Chatted:Connect(function(Msg)
if Msg:sub(1, 5) == prefix.."pin " then
script.Parent.PinnedMessage.Text = Msg
end
local Target = Players:FindFirstChild(Msg:sub(6))
end
end)
end
Thank you in advance!