To start, My script is supposed to put a "(Name) joined the game" Message in the chat
I have a script a local script and a remote event for this,
In Replicatedstorage i have ReplicatedStorage.Events(a folder).Added(a remote event)
local events = game.ReplicatedStorage.Events
local Players = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(plr)
events.Added:FireAllClients()
end)
And my local script for putting the message in chat: (Located in startergui)
local events = game.ReplicatedStorage.Events
local starterGui = game.StarterGui
local Players = game:GetService("Players")
events.Added.OnClientEvent:Connect(function(plr)
starterGui:SetCore("ChatMakeSystemMessage",{
Text = plr.Name.." has arrived to the island";
Color = Color3.fromRGB(255,0,0);
Font = Enum.Font.Creepster;
FontSize = Enum.FontSize.Size32;
})
end)
My error message is :
Players.Goblinc0re.PlayerGui.Message:7: attempt to index nil with Name
(goblinc0re is my username)
If you could provide any help i would appreciate it
