#I'm doing something wrong.

16 messages · Page 1 of 1 (latest)

pseudo fog
pine pivot
#

If you send the code as a message

#

I cant try to tell you why

#
—copy this message text and replace this comment with your script
terse ridge
# pseudo fog
local plr = game.Players.LocalPlayer

local char = plr.Character or plr.CharacterAdded:Wait()
char:WaitForChild("HumanoidRootPart").Anchored = true


local mouse = plr:GetMouse()

local camera = workspace.CurrentCamera

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.CameraStartPosition.CFrame

local tweenService = game:GetService("TweenService")

local mainMenuGui = script.Parent

local mainMenuBG = mainMenuGui:WaitForChild("MainMenuBackground")

local playBtn = mainMenuBG:WaitForChild("PlayButton")

local originalCFrame = camera.CFrame
local scaleFactor = 1000


game:GetService("RunService").RenderStepped:Connect(function()


    local centreOfScreen = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y / 2)

    local mouseDistanceFromCentre = Vector3.new((-mouse.X - centreOfScreen.X) / scaleFactor, (mouse.Y - centreOfScreen.Y) / scaleFactor, 0)


    camera.CFrame = originalCFrame * CFrame.new(originalCFrame.LookVector + mouseDistanceFromCentre)
end)


local playButtonClicked = false

playBtn.MouseButton1Click:Connect(function()

    if playButtonClicked then return end
    playButtonClicked = true



    mainMenuBG:TweenPosition(UDim2.new(-1, 0, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 3, true)


    wait(3)


    char.HumanoidRootPart.Anchored = false
    char.HumanoidRootPart.CFrame = workspace.SpawnPart.CFrame

    camera.CameraType = Enum.CameraType.Custom

    mainMenuGui:Destroy()
end)


local creditsOpen = false


local function hoverOnButton(btn)

    if playButtonClicked then return end

    local colourDarken = tweenService:Create(btn, TweenInfo.new(0.1, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {ImageColor3 = Color3.fromRGB(221, 221, 221)})
    colourDarken:Play()
end

local function hoverOffButton(btn)

    if playButtonClicked then return end

    local colourNormal = tweenService:Create(btn, TweenInfo.new(0.1, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {ImageColor3 = Color3.fromRGB(255, 255, 255)})
    colourNormal:Play()
end

playBtn.MouseEnter:Connect(function()

    hoverOnButton(playBtn)
end)
#

@pine pivot there you go

pine pivot
#

@pseudo fog

#

Any errors?

#

@terse ridge ty

pseudo fog
# pine pivot Any errors?

I apologize for such a delay, yes, in some ways, definitely, when I run the test, nothing works for me. The "Play" button doesn't respond when I press it.

pseudo fog
# pine pivot

And thank you for this, otherwise I didn’t understand how to do this

pseudo fog
#

a.. knife it's object