Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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?

5 comments

0

DUDE read my bio it will explain things.

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.

0

thats what it is rn

0

Have you tried doing Part:SetNetworkOwner(nil)? It seemed to fix the problem for me.

0

ayy that works, thanks man ^

1 answer

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.

4 comments

0

smh

0

For the position, you will have to have 4 numbers, for example: 0,0 0,0

0

DUDE read my bio it will explain things.

0

correction, vectors are 3 numbers

This discussion is preserved as it was. New answers, comments, and votes are closed.