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

How do you do a part generator?

Asked by 10 years ago

Hello, I am Decorpsesonator. I need help doing a voice activated part generator. For instance, this part generator will generate a map that I created by means of speaking/chatting it. I did a simple voice map cloner but it does not work. Please do help me in my problem. If you do reply fast, that would be magnificent. Thank you.

1 answer

Log in to vote
0
Answered by
jav2612 180
10 years ago

I'm guessing you already have the model, so I'm going to just put an example in for that.

model = WhereEverTheModelIs
modelc = model:Clone()
modelparent = model.Parent

function Chatted(msg, player)
    if player.Name = "YourUsername" then
        if string.lower(msg) == "msg that activates generator" then
            c = modelc:Clone()
            c.Parent = modelparent
            c:MakeJoints() -- may or may not be necessary
        end
    end
end

function PlayerAdded(player)
    player.Chatted:connect(function(msg) Chatted(msg, player) end)
end

game:GetService("Players").PlayerAdded:connect(PlayerAdded)
0
On line 6, you forgot to do '=='. Instead you wrote '='. Just pointing out an error for the @OP systematicaddict 295 — 10y
Ad

Answer this question