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

is it possible if this will work inside a part?

Asked by 8 years ago

This just something that make it were only that person can see

local player = game.Players.LocalPlayer
local userids = {} -- put IDs of players that you want to have the GUI here, then enable the script
yeah = false

for z = 1, #userids do
    if userids[z] == player.userId then
        yeah = true
    end
end

if yeah == false then
    script.Parent:Destroy()
end

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

I haven't fully read the script, but instead of going through all of that trouble, you could parent the part from ServerStorage into the player's CurrentCamera.

Alternatively, have the object placed in the CurrentCamera (in the studio explorer), and have the script you've made. The only change I would make is putting the LocalScript inside the player (such as StarterGui to go into the player's PlayerGui), and changing line 12 to game.Workspace.CurrentCamera.Part to reference the part.

Hope I helped!

Ad

Answer this question