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

[2] Camera is not working Online mode?

Asked by
Qorm 100
9 years ago

*REPOST*. The last question I asked about this was UNANSWERED OK. So here's what's making me very frustrated; I made a few scripts, so the camera locks on to a position and target . That works! Ok. My problem is, when I try to disable it from my teleporter script, the camera breaks and doesn't change subjects or target. Here's the Camera script:

wait(0.01) --for studio. forget about it
local player=script.Parent.Parent
local cam=game.Workspace.Camera
cam1=game.Workspace.cam1
cam.CameraType="Scriptable"
pos=cam1.Position
targ=player.Character.Torso.Position

cam.CoordinateFrame=CFrame.new(pos,targ)

while cam~=nil and wait() do
    cam.CoordinateFrame=CFrame.new(pos,player.Character.Torso.Position)
end

This works, however, in studio, it shows this: http://i.imgur.com/5juwrNX.png yes, i created a surfacegui to show me And in Online mode, it shows this: http://i.imgur.com/ZByKxap.png I know it has something to do with Local or something.. Ok, so this probably won't matter, but just in case; here's the Teleport script, where everything goes to hell:

game.Players.PlayerAdded:connect(function(currentplayer)
    local ccurrentplayer=currentplayer
script.Parent.Touched:connect(function(onTouch)
    ccurrentplayer.PlayerGui.camera1.Disabled=true
    local player=onTouch.Parent
    if player.Humanoid~=nil then
        player.Torso.CFrame=game.Workspace.teleport1.CFrame
        for i=1,0,-0.1 do
            ccurrentplayer.PlayerGui.black.base.BackgroundTransparency=i
            wait()
        end
        local camera=game.Workspace.Camera
        camera.CameraType="Custom" --DOESN'T WORK.....
        wait(1.55)
        for i=0,0.75,0.01 do
            ccurrentplayer.PlayerGui.black.base.BackgroundTransparency=i
            wait()
        end
    else return end
end) end)

The whole script above works except for the Camera part. If ANYONE can help me, it would be VERY much appreciated, because I can't continue on with my game if It keeps on being like this.

1
You absolutely cannot manipulate the camera through the server. You will need a server script. Only reason why it worked in studio is due to studio treating all scripts as local. Lacryma 548 — 9y

1 answer

Log in to vote
0
Answered by
bobder2 135
9 years ago

Needs to be done in a localscript. I had this same problem with a class selection screen.

Ad

Answer this question