Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Whats wrong with this .Chatted? [ SOLVED ]

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

✓ Accepted answer

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)

3 comments

0

The load map now works, but the Close will not do anything.

0

It appears that Map1 and Map2 will not name its Clone to Mapper

0

Wait simple fix, thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.