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

Whats wrong with this .Chatted? [ SOLVED ]

Asked by 10 years ago

What this does is if I chat "open1" or "open2" it will clone that piece from Lighting, its clone will be in workspace and its name will be Mapper.

Edit: open1 and open2 work. Close still does not Edit 2: All works :)

-- Put this in the StarterPack!

local Player = script.Parent.Parent

function Map1(msg)
    if Player.Name == "ggggyourface23" and msg == "open1" then
        q = game.Lighting.Map1:clone()
        q.Parent = Workspace
        q.Name = Mapper

    end
end

function Map2(msg)
    if Player.Name == "ggggyourface23" and msg == "open2" then
        m = game.Lighting.Map2:clone()
        m.Parent = Workspace
        m.Name = Mapper

    end
end

function Close(msg)
    if Player.Name == "ggggyourface23" and msg == "close" then
        game.Workspace.Mapper:Remove()

    end
end

script.Parent.Parent.Chatted:connect(Map1)
script.Parent.Parent.Chatted:connect(Map2)
script.Parent.Parent.Chatted:connect(Close)

There is no errors in F9 console, output or the script in general. This is all in a normal script inside starterpack

1 answer

Log in to vote
1
Answered by
bbissell 346 Moderation Voter
10 years ago

It might be the Player variable. I would change it to this:

local Player = game.Players.LocalPlayer

This would also effect the function calls..

Player.Chatted:connect(Map1)
Player.Chatted:connect(Map2)
Player.Chatted:connect(Close)
0
The load map now works, but the Close will not do anything. ggggyourface23 63 — 10y
0
It appears that Map1 and Map2 will not name its Clone to Mapper ggggyourface23 63 — 10y
0
Wait simple fix, thanks! ggggyourface23 63 — 10y
Ad

Answer this question