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

help with CurrentCamera?

Asked by 8 years ago

I've been trying to make a Local part wall that only appears if a player doesn't have the required gamepass to get through it and its gone if you have the gamepass and someone has told me to

"Store the part in CurrentCamera for each player, do an if statement for the gamepass. If a player owns the gamepass, remove the part from THEIR CurrentCamera."

I'm not exactly sure how to do this.

1 answer

Log in to vote
0
Answered by
xuefei123 214 Moderation Voter
8 years ago

I used to have this issue but I use this script in StarterPack, make it Local

wait(2)
local player = game.Players.LocalPlayer--Gets the player
if player:FindFirstChild("VIP") then--In a seperate script determine if they are VIP and make something in the player called vip if they are
    if game.Workspace.CurrentCamera:FindFirstChild("VIPDoor") == nil then--Make sure that there is no door currently
        local door = game.Lighting.VIPDoor:Clone()
        door.Parent = game.Workspace.CurrentCamera
    end
elseif not player:FindFirstChild("VIP") then--if there isn't it will make one.
    if not game.Workspace.CurrentCamera:FindFirstChild("NONVip") or not game.Workspace.CurrentCamera:FindFirstChild("VIPDoor") then
        local door = game.Lighting.NONVip:Clone()
        door.Parent = game.Workspace.CurrentCamera
    end     
end

This is just an example, you will have to edit this a bit.

If this helped go ahead and accept the answer, it gives us both rep!

Ad

Answer this question