Help with Private Server stuff

I am trying to learn how to make private server only updates.

I have seen the developer post (whatever you call it) about how to check if the server is a VIP server.
So, I am testing it with changing a parts property only if it is a VIP server. But I don’t really understand how to incorporate Workspace.Part.Transparency = 1 Into this (from the post teaching about the API)

 
-- is this a VIP server?
if game.PrivateServerId ~= "" and game.PrivateServerOwnerId ~= 0 then
 
    -- listen for new players being added
    Players.PlayerAdded:Connect(function(player)
 
        -- check if the player is the server owner
        if player.UserId == game.PrivateServerOwnerId then
            print("The private server owned has joined the game")
        end
    end)
end
1 Like

Basically what you’re doing is checking if it’s a vip server by checking the private server id, if it is then the code will run, the if statement runs when the server starts, so you can put it directly after the if statement if you want it to run when that happens, you can put it inside the player added function to change the transparency every time a player joins, or inside the if statement that checks if its the owner, which will only run when the owner of the vip server joins.

1 Like

when I do this:

Workspace.Part.Transparency  = 1 

A error under under the line “Workspace” appears. Aka, a red line appears under Workspace.

Hey! I am pretty sure it works! Might just be a studio bug or something! Thanks for your help!

A red/orange line appears due to the fact that Workspace is deprecated. You should be using workspace instead to get the Workspace service.

1 Like

Oh. Alright! Thanks for that! Really helps me with my update!

try

workspace.Part
--Instead of
Workspace.Part

You do this because Workspace is deprecated in favor of just workspace, so either one of these methods will work:

game.Workspace.Part
--Otherwise you can just do
workspace.Part
--Without the capital W and without game.

Hope this helped!

2 Likes

Alright! It is fixed! Thanks for helping, both of you! It really helps the update get out quicker!

1 Like