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

Is it possible to make someone see something that everyone else cant? (More in bio)

Asked by 4 years ago

I'm planning on making a portal tool, that a player can spawn, and its visible to all players, including the client who spawned it, and after a certain amount of time, lets say.. 5 seconds or so, the portal vanishes for everyone, but if the client that has spawned it, or anyone else enters the portal, they'll vanish with the portal, but for the client, they can still see it from the inside if that makes sense, feel free to ask any questions if this isn't clear enough, any advice appreciated, thank you in advance.

0
It's hard to understand could you explain more? BlackOrange3343 2676 — 4y
0
So, you spawn the portal in by clicking with a tool, and it's visible to all players, and so after 5 seconds it's invisible to everyone, including the person who spawned it. But, if anyone walks into the portal before the 5 seconds, they vanish with the portal, but the portal is still visible to the people that walked into it. TheJacksterYT 19 — 4y
0
So you need bool values to check whenever the player walks into the portal AswormeDorijan111 531 — 4y

1 answer

Log in to vote
1
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

whenever you do something in a local script, those changes only reflect for the player, not everyone else in the server.

there's some exceptions like with character physics (animations, character movement etc), that get replicated to the server no matter what, but everything else does not change the server.

if i was to make a part transparent in a local script, that change would only show for me, not anyone else in game.

I'm planning on making a portal tool, that a player can spawn, and its visible to all players, >including the client who spawned it

give the player a tool in a server script (normal script). everyone can see this.

after a certain amount of time, the portal vanishes for everyone aside from the client that has >spawned it

on the server, fire a remote event (called hidePortal) that will hide the portal for everyone else except the client who spawned it:

--server script
--this script is inside the portal so it'll run when it's cloned
hidePortal = game:GetService("ReplicatedStorage").hidePortal
portal = script.Parent
playersTouchingPortal = {}

wait(5) --wait 5 seconds before making portal dissapear 
--to whatever you need to do here to determine if there in the portal. Maybe GetTouchingParts() if the portal is an area

hidePortal:FireAllClients(playersTouchingPortal, portal)

--local script:
player = game.Players.LocalPlayer 
hidePortalEvent = game:GetService("ReplicatedStorage").hidePortal

function HidePortal(playersInPortal, portal)

--if were not in the portal make the portal invisible for us
for _, portalPlayer in pairs(playersInPortal)do
    if(player ~= portalPlayer)then
                --make portal invisible
        for i, v in pairs(portal:GetDescendants())do
            if(v:IsA("BasePart"))then
                v.Visible = false
                v.CanCollide = false
            end
        end
    end
end

hidePortalEvent.OnClientInvoke = HidePortal

anyone who has enters the portal, they'll vanish with the portal, but for the client, they can >still see it from the inside if that makes sense

not sure what you mean by that ^^

0
So, you spawn the portal in by clicking with a tool, and it's visible to all players, and so after 5 seconds it's invisible to everyone, including the person who spawned it. But, if anyone walks into the portal before the 5 seconds, they vanish with the portal, but the portal is still visible to the people that walked into it. TheJacksterYT 19 — 4y
0
Right ok royaltoe 5144 — 4y
0
I'll update royaltoe 5144 — 4y
0
Should work now. Never tested it though so lmk if you have any errors and pls mark as solved thx royaltoe 5144 — 4y
Ad

Answer this question