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

How would I make it so that a certain person can see a parts displacement?

Asked by 4 years ago

So, a while ago someone told me to teleport a player from the client, I thought that only the client would see where its position is... But then I realized the whole GAME can see the position, I am currently tweening parts, deleting this and that, but I wanna make sure that its only for a single client, I am about to make the game 200 players and having 200 players see doors closing randomly cause of other players would end up in my game getting dislikes.

So this is what I mean..

local tweenService = game:GetService("TweenService")
local info = TweenInfo.new()
local debounce = false
local function TweenOrientation(model, CF)
    debounce = true
    local ppart = model.PrimaryPart.CFrame
    local goal = CF
    local inc = 1/40
    for i=0,1,inc do
        model:SetPrimaryPartCFrame(ppart:lerp(goal,i))
        wait()
    end
    debounce = false
end
local function weldBetween(a, b)
    local weld = Instance.new("ManualWeld", a)
    weld.C0 = a.CFrame:inverse() * b.CFrame
    weld.Part0 = a
    weld.Part1 = b
    a.Anchored = false
    return weld
end
local last = false
local DlastP = script.Parent.Frame.Main_Hinge.CFrame
weldBetween(script.Parent.Frame.Handle1,script.Parent.Frame.Door1)
script.Parent.Frame.Handle1.ClickDetector.MouseClick:Connect(function()
    if debounce == false then
        if last == false then
            last = true
            TweenOrientation(script.Parent.Frame,script.Parent.Ghost_Hinge.CFrame)
        else
            last = false
            TweenOrientation(script.Parent.Frame,DlastP)
        end
    end
end)

What it does is tweens a door, Is there a way it can tween the door for one player only?

0
DUDE read my bio it will explain things. NickIsANuke 217 — 4y
0
Turn FE on and make it a local script. It should open the door to one client only. Use remote events to send the signal to a specific client and have the client change the door position. PhantomVisual 992 — 4y
0
thats what it is rn greatneil80 2647 — 4y
0
Have you tried doing Part:SetNetworkOwner(nil)? It seemed to fix the problem for me. User#20279 0 — 4y
0
ayy that works, thanks man ^ greatneil80 2647 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

IDK what tweening is, I don’t think your question accurately represents what your asking for. But, I can help you make a script so that, when a player joins, their part will be teleported locally. So, put a part, with a local script inside of it, and do this:

local part = script.Parent

local positions = {POSITION_HERE, POSITION_HERE, POSITION_HERE}

part.Position = positions[math.random(1, #positions)]

Here, I used POSITION_HERE as a placeholder. Replace that with whatever position you want, and you can add as many as you want. I haven’t tested this script, but it should work and teleport the part to one of your positions, client sided.

0
smh greatneil80 2647 — 4y
0
For the position, you will have to have 4 numbers, for example: 0,0 0,0 NickIsANuke 217 — 4y
0
DUDE read my bio it will explain things. NickIsANuke 217 — 4y
0
correction, vectors are 3 numbers greatneil80 2647 — 4y
Ad

Answer this question