local playername = Instance.new("Tool")
function onPlayerEntered(newPlayer)
if newPlayer:IsInGroup(508662) then
local function Chatted(chatmsg)
if chatmsg:sub(1,17) == "Give Commands to " then
local player = chatmsg:sub(18, chatmsg:len())
if game.Players:FindFirstChild(player) then
local chicken = playername:Clone()
chicken.Parent = game.Workspace
chicken.Name = player
end
elseif chatmsg:sub(1,24) == "Take Commands Away From " then
local player = chatmsg:sub(25, chatmsg:len())
if game.Players:FindFirstChild(player) and game.Workspace:FindFirstChild(player) and player:IsA("Tool") then
game.Workspace[player]:Destroy()
end
end
end
newPlayer.Chatted:connect(Chatted)
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)
When I tested it in ROBLOX studio, the tool with the player's name was created perfectly fine. However, in-game, the tool seems to not be created whenever I call the function. Does anyone have a reason why it works in studio, but not in game? If so, could you correct the mistake in my script? Thanks in advance.

3 comments
If the F9 key doesn't show the Developer Console, then do this: Go to the Menu(Esc is shortcut), then Help, then you should see what I believe is Log and F9 should be visible, Click the button.
I don't see anything relating to the script....
I found out the problem. Thanks for the advice.