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

Not Getting Character Correctly?

Asked by
jdflyer -9
7 years ago
Edited 7 years ago

I have a spawn gui and in a button when you click it changes a value, which is used in the start script. In the button with the value the camera changes the CameraSubject correctly

--This is the one that changes the camera first
local cam = game.Workspace.CurrentCamera

button.MouseButton1Down:connect(function()
    game.Players.LocalPlayer.PlayerGui.Start.SpawnSelected.Spawn.Value = ("People Spawn")
    game.Players.LocalPlayer.PlayerGui.Start.SpawnSelected.Text = (game.Players.LocalPlayer.PlayerGui.Start.SpawnSelected.Spawn.Value)
    cam.CameraSubject = game.Workspace.ControlPoint
end)

In the start script I have it where if the value is equal to a value it does stuff, but I'm trying to have a fix of camera to the character.

--This is without variables and still doesn't work
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid

This is also in a local script and the roblox wiki said it works, but it still does not work.

Can someone tell me what is happening and what i'm doing wrong?

Edit: I got a print to return the name of the character I think I just need to fix now.

0
Try setting up your player and character variables before, donnybrook 20 — 7y
0
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:wait() donnybrook 20 — 7y
0
Still doesn't work jdflyer -9 — 7y

Answer this question