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

Single player seeing through walls?

Asked by
saenae 318 Moderation Voter
8 years ago

Hey guys, I've been wondering for a while now how one would go about creating a script which would allow a single player to see through walls, while others are still incapable of doing so. This capability is seen in a few stealth-oriented games such as The Last of Us (Joel's listening mode), Dishonored (Corvo's Dark Listening mode), etc.

I'm not asking for the script, but for some help on the concept itself. If you have any ideas and decide to share them, I'd greatly appreciate it :).

0
If the game is filtering enabled, you could have a local script placed in the specific character to change the transparency of the bricks and it should not be replicated to other clients. M39a9am3R 3210 — 8y

3 answers

Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
8 years ago

One way of doing this is to put a SurfaceGui inside the PlayerGui, and set it's Adornee to the specific wall/block. You could then use scripts to decide which players are allowed to see through it or not, by making a frame visible/invisible.


This script would go inside the SurfaceGui:

script.Parent.Adornee = game.Workspace.Wall --Change this if you need to.

I'm not sure what type of game you're making, but that's all you really need anyways. Now you would just need to put a frame into the SurfaceGui that covers the entire wall, and make it invisible or visible depending on certain factors in your game.


If you need me to elaborate more on how you would go about this, leave a comment below, and I'll see what I can do. Anyways, hope I helped :P

0
Hey Dyler, thanks a ton for the answer. Having some trouble though; I did as you said, but I'm still unsure on how this helps me see through the wall -- perhaps I misunderstood what you were saying. saenae 318 — 8y
0
Oh, sorry, you would need to make the wall transparent, and on the side you want to be able to see through put the surfacegui. Message me on Roblox if you're still stuck, and I can help you from there. dyler3 1510 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

You could go with the simple method and having the entire game be copied locally in the players thus adding the options to see through the walls whilst others cannot.

0
I'd thought of that, and that wouldn't be too much of a problem if the game wasn't as detailed as it is. At this point, I feel like it would be too much for each client to handle. Then again, I'll probably give it a try for the heck of it. saenae 318 — 8y
Log in to vote
0
Answered by 8 years ago

I think the best option would to insert parts into the player's Camera. The problem with this method is you have to use a script to generate the part for certain players. So in other words every time that player respawns you will have to have code that creates the part for that player again. Which means positioning, scaling, rotating, and all the other details just to have it local to the player. But it would work. Here's an example:

--LOCALSCRIPT! Put this in the backpack or startergui and it should work fine. DO NOT USE A NORMAL SCRIPT!!

local Player = game.Players.LocalPlayer --Get the player
local Permission = true --This is just for the example. If it is true then the player can walk through the wall, and vise versa.

local part = Instance.new("Part")
if not Permission then
    part.CanCollide = true
    part.Transparency = 0
elseif Permission then
    part.CanCollide = false
    part.Transparency = 0.75
end
part.Anchored = true
part.Position = Vector3.new(10, 5, 43)
part.Size = Vector3.new(10, 10, 1)
part.Reflectance = 0.5
part.Parent = game.Workspace.CurrentCamera --VERY IMPORTANT!

Remember, it's only an example. It's not what you would want exactly. It's just to give you an idea of what to do.

Answer this question