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

Why does the client replicate to a non-experimental server?

Asked by
Bisoph 5
7 years ago

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:

01local ReplicatedStorage = game.ReplicatedStorage
02 
03local playersActivated = {}
04 
05 
06script.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,
12            workspace.CageRod,
13            workspace.CageRod.CFrame + Vector3.new(0, 10, 0),
14            3)
15        ReplicatedStorage.ClientManipulation.TweenObject:InvokeClient(player, script.Parent, script.Parent.CFrame - Vector3.new(0, 0.5, 0), 0.5)
View all 22 lines...

Client code:

01local functionFolder = game:GetService('ReplicatedStorage'):WaitForChild('ClientManipulation')
02local player = game.Players.LocalPlayer
03 
04functionFolder: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
10    end
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()
View all 26 lines...

Please, if you know the solution to this, post it below.

1 answer

Log in to vote
0
Answered by 7 years ago

It's cause you were testing it in studio. Try the network function thingy, I can't remember what it's called because I'm not currently in studio. You can also try team test. Both work.

0
You even say you were testing in a local server. DaWarTekWizard 169 — 7y
Ad

Answer this question