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

My "Owner joined announcer in chat" script works on studio, but not in game?

Asked by 7 years ago

My script is just making a chat message when the owner enters, this is my script:

Owner = "Velege1"

function Join(plyr) if plyr.Name == Owner then game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{ Text = ("[SERVER]: Owner (Velege1) has entered the game."); Color = Color3.new(255,255,255); Font = Enum.Font.SourceSansBold; FontSize = Enum.FontSize.Size18; }) end

end game.Players.PlayerAdded:connect(Join)

It works on studio, but not on my game.

2 answers

Log in to vote
0
Answered by 7 years ago

Sorry, here is the script i used, i'm not ussing comments because it won't show it properly

Owner = "Velege1"

function Join(plyr) if plyr.Name == Owner then game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{ Text = ("[SERVER]: Owner (Velege1) has entered the game."); Color = Color3.new(255,255,255); Font = Enum.Font.SourceSansBold; FontSize = Enum.FontSize.Size18; }) end

end game.Players.PlayerAdded:connect(Join) --

0
Really... Velege1 2 — 7y
0
In the future when you need to make changes, you can just edit your question instead of posting under your own question. Troidit 253 — 7y
0
Put this in a codeblock? Prestory 1395 — 7y
Ad
Log in to vote
0
Answered by
OfcPedroo 396 Moderation Voter
7 years ago
Edited 7 years ago

What you wrote isn't that bad, but that's not how you do it. Try this:

local Owner = "Velege1"

game.Players.PlayerAdded:connect(function(player)
    if player.Name == Owner then
        repeat wait() until player:WaitForChild("PlayerGui")
        --You gotta specify the gui and its full childs, or that won't work. Because of that, I'm gonna use player.PlayerGui.TestGui.TestFrame.TestTextLabel(.Property). You gotta change that with the correct directory.
        player.PlayerGui.TestGui.TestFrame.TestTextLabel.Text = "[SERVER]: Owner (Velege1) has entered the game."
        player.PlayerGui.TestGui.TestFrame.TestTextLabel.TextColor3 = Color3.new(255/255, 255/255, 255/255)
        player.PlayerGui.TestGui.TestFrame.TestTextLabel.Font = Enum.Font.SourceSansBold
        player.PlayerGui.TestGui.TestFrame.TestTextLabel.FontSize = Enum.FontSize.Size18

Answer this question