Greetings Developer, Can someone help me fixing my command script?
local Group = 000000
local MinRank = 0
game.Players.PlayerAdded:Connect(function(player)
script.TrainerTitle:Clone().Parent = player.Character.Head
player.Chatted:Connect(function(message)
if string.lower(message) == "!train" and player:GetRankInGroup(Group) >= MinRank then
player.Character.Head.TrainerTitle.Enabled = true
end
end)
end)
local Group = 6419782
local MinRank = 12
game.Players.PlayerAdded:Connect(function(player)
local Character = player.Character
local Clone = script.TrainerTitle:Clone()
if Character then
local Head = Character:FindFirstChild('Head')
if Head then
Clone.Parent = Head
end
end
player.Chatted:Connect(function(message)
if string.lower(message) == "!train" and player:GetRankInGroup(Group) >= MinRank then
player.Character:FindFirstChild("Head").TrainerTitle.Enabled = true
end
end)
end)
local Group = 6419782
local MinRank = 12
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local Clone = script.TrainerTitle:Clone()
local Head = char:WaitForChild('Head')
player.Chatted:Connect(function(message)
if string.lower(message) == "!train" and player:GetRankInGroup(Group) >= MinRank then
Head.TrainerTitle.Enabled = true
end
end)
end)
end)
local Group = 6419782
local MinRank = 12
game.Players.PlayerAdded:Connect(function(player)
local isTrainer = false
player.Chatted:Connect(function(message)
if string.lower(message) == "!train" and player:GetRankInGroup(Group) >= MinRank then
isTrainer = true
local Clone = game.ReplicatedStorage.TrainerTitle:Clone()
Clone.Parent = player.Character.Head
end
end)
end)
local Group = 6419782
local MinRank = 12
local TrainerTitle = script.TrainerTitle
game.Players.PlayerAdded:Connect(function(player)
local Character = player.Character or player.CharacterAdded:Wait()
local Head = Character:FindFirstChild('Head')
if Head then
TrainerTitle:Clone().Parent = Head
end
player.Chatted:Connect(function(message)
if string.lower(message) == "!train" and player:GetRankInGroup(Group) >= MinRank then
Head.TrainerTitle.Enabled = true
end
end)
end)
You’re welcome.
And, you were doing a few things wrong, you might be able to spot what.