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

player.userID = game.CreatorID then?

Asked by 6 years ago
Edited 6 years ago

So i am learning how to script and i look through free models to learn.. When looking through this free model, i dont understand how it works..

function OnPlayerEntered(player)
    if player.userId == game.CreatorId then --What does this mean?
        local msg = Instance.new("Message")
        msg.Parent = game.Workspace
        msg.Text = "The creator has joined the server!"
        wait(2)
        msg:remove()
    elseif  player:IsFriendsWith(game.CreatorId) then
        local msg = Instance.new("Message")
        msg.Parent = game.Workspace
        msg.Text = "A friend of the creator has joined the server!"
        wait(2)
        msg:remove()
    elseif player:IsBestFriendsWith(game.CreatorId) then
        local msg = Instance.new("Message")
        msg.Parent = game.Workspace
        msg.Text = "A best friend of the creator has joined the server!"
        wait(2)
        msg:remove()
    elseif player.Name == "builderman" or player.Name == "Telamon" or player.Name == "ROBLOX" or player.Name == "RobloShorty" or player.Name == "RobloSam" or player.Name == "RobloTim" or player.Name == "noob007" or player.Name == "MattDusek" or player.Name == "Matt Dusek" or player.Name == "clockwork" or player.Name == "jeditkacheff" or player.Name == "HotThoth" or player.Name == "Hotthoth" or player.Name == "hotthoth" or player.Name == "BrightEyes" or player.Name == "brighteyes" or player.Name == "Brighteyes" or player.Name == "erik.cassel" or player.Name == "ReeseMcBlox" or player.Name == "Madrak" then
        local msg = Instance.new("Message")
        msg.Parent = game.Workspace
        msg.Text = "A ROBLOX admin has joined this server!" --Just somethin' neat.
        wait(2)
        msg:remove()
    end
end

game.Players.ChildAdded:connect(OnPlayerEntered)

Thanks!

1
Don't use free models, they are often broken due to deprecated items being removed. hiimgoodpack 2009 — 6y
1
Also, that one is VERY outdated as you cannot have best friends in roblox anymore D: hiimgoodpack 2009 — 6y
0
Then how can i improve my scripting skills? casperfox 0 — 6y
View all comments (7 more)
0
Also, see what this guy said https://devforum.roblox.com/t/removing-ability-to-require-non-owned-module-scripts/24522/35 . If you continue using free models, you will probably get nowhere since 99% of them use deprecated stuff, which can be deleted at any time. So, don't trust other people's code. hiimgoodpack 2009 — 6y
0
remove is depricated(Remove changes the part parent to nil but does not completly remove it. ROBLOX depricated it since it is very easy to make a part to nil. By the way, nil means nothing), instead of remove, change it do Destroy, so technically, on line 25,line 13 and line 7, you would put msg:Destroy() saSlol2436 716 — 6y
0
Plus, if you are a begginner in scripting, it's best to get the habit of connecting events with Connect, not connect and disconnecting events with Disconnect and not disconnect and waiting for the event to happen with Wait, not wait saSlol2436 716 — 6y
0
Another thing to remember is to put the properties first since it does not give too much lag, then parent the object,for example, if I were to create a part and I wanted to set the properties, then the parent, that method would be great practice, if you were to create a part, then put the parent and then do properties, then it would be bad practice and it would cause lag in your game saSlol2436 716 — 6y
0
Use the wiki for reference, use youtubers like AlvinBlox to learn specific things, and go here to ask questions you can't solve on your own. Viking359 161 — 6y
0
Also, just don't use free models if you don't know how to script and don't examine them for viruses. See https://www.reddit.com/r/roblox/comments/75owub/psa_remove_kohls_admin_infinite_from_your_game/ hiimgoodpack 2009 — 6y
0
The best place to learn is the wiki: http://wiki.roblox.com Thundermaker300 554 — 6y

Answer this question