Why does the client replicate to a non-experimental server?
I'm making an adventure game, and I made a button that lifts a certain object in the client. To make sure it only happens to the client, I disabled experimental mode. When I test it in a local server, something weird happens: when the client lifts the object, the server also lifts the object. I don't know why this is happening. I'm pretty sure it's not my fault.
Server code:
01 | local ReplicatedStorage = game.ReplicatedStorage |
03 | local playersActivated = { } |
06 | script.Parent.Touched:Connect( function (hit) |
07 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
08 | print (playersActivated [ player ] ) |
09 | if player and playersActivated [ player ] = = nil then |
10 | playersActivated [ player ] = player |
11 | ReplicatedStorage.ClientManipulation.TweenObject:InvokeClient(player, |
13 | workspace.CageRod.CFrame + Vector 3. new( 0 , 10 , 0 ), |
15 | ReplicatedStorage.ClientManipulation.TweenObject:InvokeClient(player, script.Parent, script.Parent.CFrame - Vector 3. new( 0 , 0.5 , 0 ), 0.5 ) |
17 | ReplicatedStorage.ClientManipulation.TweenCamera:InvokeClient(player, |
18 | CFrame.new( 73.3383026 , 14.7632408 , - 39.4837646 , 0.998810053 , 0.0133609381 , - 0.0469054841 , 9.31322686 e- 10 , 0.961743772 , 0.273950845 , 0.0487712994 , - 0.273624867 , 0.960599184 ), |
19 | CFrame.new( 74.327774 , 6.49960041 , - 62.8328209 , 0.998810828 , 0.0186573416 , - 0.0450439118 , - 0 , 0.923882961 , 0.38267538 , 0.0487550087 , - 0.382220298 , 0.92278415 ), |
Client code:
01 | local functionFolder = game:GetService( 'ReplicatedStorage' ):WaitForChild( 'ClientManipulation' ) |
02 | local player = game.Players.LocalPlayer |
04 | functionFolder:WaitForChild( 'TweenCamera' ).OnClientInvoke = function (startPos, endPos, time) |
05 | local walkSpeed, jumpPower = 16 , 50 |
06 | if player.Character then |
07 | walkSpeed, jumpPower = player.Character:WaitForChild( 'Humanoid' ).WalkSpeed, player.Character:WaitForChild( 'Humanoid' ).JumpPower |
08 | player.Character:WaitForChild( 'Humanoid' ).WalkSpeed = 0 |
09 | player.Character.Humanoid.JumpPower = 0 |
11 | local camera = workspace.CurrentCamera |
12 | camera.CameraType = Enum.CameraType.Scriptable |
13 | camera.CameraSubject = nil |
14 | camera.CFrame = startPos |
15 | game:GetService( 'TweenService' ):Create(camera, TweenInfo.new(time), { CFrame = endPos } ):Play() |
17 | camera.CameraType = Enum.CameraType.Custom |
18 | while not player.Character do wait() end |
19 | camera.CameraSubject = player.Character:WaitForChild( 'Humanoid' ) |
20 | player.Character.Humanoid.WalkSpeed = walkSpeed |
21 | player.Character.Humanoid.JumpPower = jumpPower |
24 | functionFolder:WaitForChild( 'TweenObject' ).OnClientInvoke = function (obj, endPos, time) |
25 | game:GetService( 'TweenService' ):Create(obj, TweenInfo.new(time), { CFrame = endPos } ):Play() |
Please, if you know the solution to this, post it below.