So I’m trying to create a script that makes a part move / tween for a specific client, which means that the part should not move for the other clients, and rather just stay in the original position.
Just to clarify, I’m trying to make a door tween to another position once a player has reached a certain level.
Can’t manage to figure it out, would appreciate some advice
Yeah, I’m trying to perform it on the client, and added a copy of the script below in the stats folder located in ‘game.Players.PlayerName’, but it’s not working for some reason.
I’m probs doing something wrong
Bridge1 = game.Workspace.LevelModels:WaitForChild(‘Bridge1’)
local Level = script.Parent:WaitForChild(‘LevelProgress’)
local CurrentCFrame = Bridge1.CFrame
local CurrentOrientation = CurrentCFrame - CurrentCFrame.p
local info = TweenInfo.new(5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)
Debounce = false
repeat wait() until Level.Value >= 10
if Level.Value >= 10 and Debounce == false then
Debounce = true
local PositionTween = game:GetService(“TweenService”):Create(Bridge1, info,{CFrame = CFrame.new(154.615, 5.205, -43.215) * CurrentOrientation})
PositionTween:Play()
Debounce = false
end
Try this code… (this is assuming “LevelProgress” is located directly inside the player object itself)
Bridge1 = game.Workspace.LevelModels:WaitForChild(‘Bridge1’)
local Player = game.Players.LocalPlayer
local Level = Player:WaitForChild(‘LevelProgress’)
local CurrentCFrame = Bridge1.CFrame
local CurrentOrientation = CurrentCFrame - CurrentCFrame.p
local info = TweenInfo.new(5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)
Debounce = false
repeat wait() until Level.Value >= 10
if Level.Value >= 10 and Debounce == false then
Debounce = true
local PositionTween = game:GetService(“TweenService”):Create(Bridge1, info,{CFrame = CFrame.new(154.615, 5.205, -43.215) * CurrentOrientation})
PositionTween:Play()
Debounce = false
end
Making changes on a singular client isn’t too difficult a task, especially in FilteringEnabled.
The changes you make from a LocalScript with FilteringEnabled ticked will not replicate to the rest of the clients, only the client in which the script is running from.
There are a few good resources to understand FilteringEnabled and why changes do or don’t replicate, but I would personally say the wiki is the most prominent way to gain a basic understanding:
This response is a bit broad, but I’m attempting to explain it in a way that will help you in future instances, understanding FilteringEnabled is a good step to take.