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

How do I fix this chat:connect LocalScript?

local lumos = game.StarterPack.Wand.Handle.ParticlePart.Lumos

game.Players.LocalPlayer.Chatted(function(message)
	if message == "Lumos" then
		lumos.Enabled = true
	end
end)

It is in a LocalScript. What did I mess up?

1 comment

0

a lot

3 answers

Make it a normal script inside of ServerScriptService

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(message)
		local lumos = plr:WaitForChild("Backpack").Wand.Handle.ParticlePart.Lumos
   	 if message == "Lumos" then
      	  lumos.Enabled = true
  	  end
end)
end)

you forgot to add :connect inbetween Chatted and (function(message)

Check this out

game.Players.PlayerAdded:connect(function(player)
    plr.Chatted:connect(function(message)
	repeat wait() until player:WaitForChild("Backpack")
        local lumos = player.Backpack.Wand.Handle.ParticlePart.Lumos
     if message == "Lumos" then
          lumos.Enabled = true
      end
end)
end)

If this works, please mark as solved!

As always, keep the good scripting!

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