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

.Chatted and PlayerAdded? [closed]

Asked by 9 years ago

So I've read and watched many tutorials, and I've tried the ones that fit to what I want to do with my game, which is check if there is an admin, and if the player is an admin, give them access to the commands. I DO NOT understand any of the tutorials given, I've tried all of them, and when I try them, it fails. I make sure that my player name is substituted in the script, I make sure that all the variables are right, but nothing works. I do not understand .Chatted or PlayerAdded, and I need help. If anybody can write something to help me understand how to do something if a player chats a certain phrase, then please do. For example, I want to insert a part into the game when I specifically chat, "Add Part" it just doesn't work. Anyways, here is the script. PLEASE help if you can. Why doesn't this script work?

game.Players.PlayerAdded:connect(function(player)
    if player.Name=="LastTimeLord12" then 
        player.Chatted:connect(function(msg)
            if msg=="Add Part" then 
                m=Insert.new("Message", game.Workspace)
                m.Text="Adding New Part"
                wait(2)
                m:remove()
                wait()
                Insert.new("Part", game.Workspace)


            end

        end)
    end
end)

Locked by TofuBytes, 2eggnog, and BlueTaslem

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
2
Answered by
jakedies 315 Trusted Moderation Voter Administrator Community Moderator
9 years ago

It should be Instance.new, not Insert.new for lines 5 and 10.

0
:P such an obvious mistake...thanks! LastTimeLord12 5 — 9y
0
It's alright, we all make silly mistakes :) That's what scripting helpers is here for jakedies 315 — 9y
Ad