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)