#I have a problem coding

12 messages · Page 1 of 1 (latest)

wicked apex
#

.Activated is not for a button

#

try

#

.MouseButton1Click

chilly cargoBOT
#

studio** You are now Level 4! **studio

wicked apex
#

so i tried doing the code i dont find any problem at all in the output but when i pressed the button it doesnt work

--// services and ui
local ui = script.Parent
local players = game:GetService("Players")
local tweenService = game:GetService("TweenService")

--// buttons and frames
local menuBtn = ui:WaitForChild("Menu")
local btnsFrame = ui:WaitForChild("Buttons")
local shadowFrame = ui:WaitForChild("Shadow")

--// functions
local tween = function(obj, tinfo, propertyTable)
    return tweenService:Create(obj, tinfo, propertyTable)
end

--// actual scripts
menuBtn.MouseEnter:Connect(function()
    tween(menuBtn, TweenInfo.new(.4), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}):Play()
    tween(menuBtn.Icon, TweenInfo.new(.4), {ImageColor3 = Color3.fromRGB(255, 255, 255)}):Play()
end)

menuBtn.MouseLeave:Connect(function()
    tween(menuBtn.Icon, TweenInfo.new(.4), {ImageColor3 = Color3.fromRGB(30, 30, 30)}):Play()
    tween(menuBtn, TweenInfo.new(.4), {BackgroundColor3 = Color3.fromRGB(255, 255, 255)}):Play()
end)

menuBtn.MouseButton1Click:Connect(function()
    if btnsFrame.Position == UDim2.new(0.5, 0, 0.5, 0) then
        tween(shadowFrame, TweenInfo.new(.4), {BackgroundTransparency = 1}):Play()
        btnsFrame:TweenSizeAndPosition(
            UDim2.new(0, 0, 0, 0),
            UDim2.new(0.5, 0, 0.56, 0),
            "Out", "Quint", .7, true
        )
    else
        tween(shadowFrame, TweenInfo.new(.4), {BackgroundTransparency = .5}):Play()
        btnsFrame:TweenSizeAndPosition(
            UDim2.new(0.5, 0, 0.55, 0),
            UDim2.new(0.5, 0, 0.5, 0),
            "Out", "Quint", .7, true
        )
    end
end)
#

can you copy and paste this

#

in to your script

#

did you get this from chatGpt

#

thats the problem

#
local ui = script.Parent
local players = game:GetService("Players")
local tweenService = game:GetService("TweenService")

local menuBtn = ui:WaitForChild("Menu")
local btnsFrame = ui:WaitForChild("Buttons")
local shadowFrame = ui:WaitForChild("Shadow")

--// actual scripts
menuBtn.MouseEnter:Connect(function()
    tweenService:Create(menuBtn, TweenInfo.new(.4), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}):Play()
    tweenService:Create(menuBtn.Icon, TweenInfo.new(.4), {ImageColor3 = Color3.fromRGB(255, 255, 255)}):Play()
end)

menuBtn.MouseLeave:Connect(function()
    tweenService:Create(menuBtn.Icon, TweenInfo.new(.4), {ImageColor3 = Color3.fromRGB(30, 30, 30)}):Play()
    tweenService:Create(menuBtn, TweenInfo.new(.4), {BackgroundColor3 = Color3.fromRGB(255, 255, 255)}):Play()
end)

menuBtn.MouseButton1Click:Connect(function()
    if btnsFrame.Position == UDim2.new(0.5, 0, 0.5, 0) then
        tweenService:Create(shadowFrame, TweenInfo.new(.4), {BackgroundTransparency = 1}):Play()
        btnsFrame:TweenSizeAndPosition(
            UDim2.new(0, 0, 0, 0),
            UDim2.new(0.5, 0, 0.56, 0),
            "Out", "Quint", .7, true
        )
    else
        tweenService:Create(shadowFrame, TweenInfo.new(.4), {BackgroundTransparency = .5}):Play()
        btnsFrame:TweenSizeAndPosition(
            UDim2.new(0.5, 0, 0.55, 0),
            UDim2.new(0.5, 0, 0.5, 0),
            "Out", "Quint", .7, true
        )
    end
end)

#

can you try this

wicked apex
#

What was the problem