Code:

local button = script.Parent
local Cam = workspace.Camera
local itemcam = workspace:WaitForChild('Shop').Cams.Cam
local player = game.Players.LocalPlayer
local PlayerGui = player:WaitForChild('PlayerGui')
local Input = game:GetService('UserInputService')
local Current_Tool = player:WaitForChild('Backpack').Current_Tool
local BuyStick = game.ReplicatedStorage:WaitForChild("RemoteEvents").Shop.Buy_Stick
---
 
 
button.Activated:Connect(function()
        local ScreenGui = Instance.new('ScreenGui',PlayerGui)
        ScreenGui.Name = 'Shop_UI'
        local Frame = Instance.new('Frame',ScreenGui)
        local   Buy_Button = Instance.new('TextButton',ScreenGui)
                Buy_Button.Name = 'Buy_Button'
        Frame.Size = UDim2.new(0, 1920,0, 1079)
        Frame.Position = UDim2.new(0, 0,0, 0)
        Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
        Frame.BackgroundTransparency = 1
        Frame.BackgroundColor3 = Color3.fromRGB(255, 229, 124)
        --Fade
        for i = 1,20 do
                Frame.BackgroundTransparency = Frame.BackgroundTransparency -0.05
                wait(0.01)
        end
 
        repeat wait()
        Cam.CameraType = Enum.CameraType.Scriptable
until Cam.CameraType == Enum.CameraType.Scriptable
        Cam.CFrame = itemcam.CFrame
        wait(0.5)
                for i = 1,20 do
                Frame.BackgroundTransparency = Frame.BackgroundTransparency +0.05
                wait(0.01)
                end
                        Buy_Button.Name = 'Buy_Button'
                        Buy_Button.Font = Enum.Font.Cartoon
                        Buy_Button.TextScaled = true
                        Buy_Button.Text = 'Buy'
                        Buy_Button.BorderSizePixel = 3
                        Buy_Button.BorderColor3 = Color3.fromRGB(255,255,255)
                                                Buy_Button.BackgroundColor3 = Color3.fromRGB(106, 209, 132)
 
                        if Input.TouchEnabled == true then --Player On Phone
                                Buy_Button.Size = UDim2.new(0, 78,0, 30)
                                Buy_Button.Position = UDim2.new(0.43, 0,0.841, 0)
                        elseif Input.KeyboardEnabled == true then
                                Buy_Button.Size = UDim2.new(0, 234,0, 90)
                                Buy_Button.Position = UDim2.new(0.42, 0,0.848, 0)
                                                                Current_Tool.Value = 'Stick'
end
---
button.MouseEnter:Connect(function()
        print("HOVERED")
        button.ImageColor3 = Color3.fromRGB(255, 222, 121)
        for i = 1,5 do
                button.Rotation = button.Rotation +2
                wait(0.01)
        end
 
                for i = 1,5 do
                button.Rotation = button.Rotation -2
                wait(0.01)
                end
                                for i = 1,5 do
                button.Rotation = button.Rotation +2
                wait(0.01)
                                end
                                                                for i = 1,5 do
                button.Rotation = button.Rotation -2
                wait(0.01)
                button.ImageColor3 = Color3.fromRGB(255, 255, 255)
 
 
Buy_Button.Activated:Connect(function()
BuyStick:FireServer()
end)
        end
                end)
                        end)

10 comments

0

Paste your code here buddy.

0

I already had it in pastebin but i'll do it

0

Could be a wait() somewhere not allowing your other function to connect?

0

After i click the button it can check if the mouse hovered.

0

so what's not working exactly? are the events both firing?

0

It dosen't check if the mouse is hovering. (That's the problem)

0

but you just said it checks if the mouse is hovering...?

0

try removing anything to do with wait() in your code temporarily. we can boil down the issue so we know it is/ isn't that

0

try removing anything to do with wait() in your code temporarily. we can boil down the issue so we know it is/ isn't that

0

Nope tried it did not work