Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i fix this CameraOffset function?

the error is: Players.32IIIIIII23.PlayerGui.ScreenGui.PLAY!.PLAYBTN.LocalScript:14: attempt to call a Vector3 value

Code:

local Btn = script.Parent
local plr = game:GetService("Players")


plr.PlayerAdded:Connect(function(plr)
	game.Players.LocalPlayer.Character.Humanoid.CameraOffset(Vector3.new(0, 14, 0))
	game.Lighting.Blur.Size = 14
end)

Btn.MouseButton1Down:Connect(function()
	Btn.Parent:TweenPosition(UDim2.new(0.29, 0, 0.297, -500, Enum.EasingDirection.In, Enum.EasingStyle.Linear, 3.0))
	wait(1)
	game.Lighting.Blur.Size = 0
	game.Players.LocalPlayer.Character.Humanoid.CameraOffset(Vector3.new(0, 0, 0))
end)

1 answer

If you're trying to change the cameraoffset, you're missing an equal sign. The equal sign (=) is used to change something. (sorry if i explained it badly)

Example:

game.Players.LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(0, 0, 0) -- The CameraOffset will now equal that Vector 3 value.

Hope this helps

This discussion is preserved as it was. New answers, comments, and votes are closed.