Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ItemInfo = require(game.Workspace.Items)
- Player = script.Parent.Parent.Parent
- PlyGame = game.Players:FindFirstChild(Player.Name)
- Mouse = Player:GetMouse()
- ItemClickScan = 0
- MaxScan = 28
- print("Welcome to RoScape " ..Player.Name .. "!")
- print("If you find any bugs please click on 'Sever Console' and send me the error in a message (redface95)")
- local debounce = false
- local ItemFrameAmount = 0
- while true do
- PlyGame:WaitForChild("Inventory")
- PlyGame.Inventory:WaitForChild("Item28")
- ItemClickScan = ItemClickScan + 1
- for i,v in pairs(script.Parent.Inventory:GetChildren()) do
- if v:FindFirstChild("ItemButton") then
- local SlotValue = v.Slot.Value
- local ItemSlotValue = PlyGame.Inventory["Item"..SlotValue]
- if ItemSlotValue.Value >= 1 then
- v.ItemButton.MouseButton2Down:connect(function()
- if debounce == true then return end
- debounce = true
- if script.Parent:FindFirstChild("ItemClick") then
- script.Parent.ItemClick:Remove()
- end
- local ItemId = ItemSlotValue.Id.Value
- print(v.Name)
- print(ItemId)
- print("RightClicked")
- local Frame = Instance.new("Frame",script.Parent)
- Frame.Name = "ItemClick"
- Frame.Size = UDim2.new(0,100,0,25)
- if ItemInfo[ItemId].CanBeEquiped == true then
- print("Can Equip")
- local Equip = Instance.new("TextButton",script.Parent.ItemClick)
- Equip.Name = "Wield"
- Equip.Text = "Wield"
- Equip.Size = UDim2.new(0,100,0,25)
- Equip.Position = UDim2.new(0,0,0,0)
- ItemFrameAmount = ItemFrameAmount + 1
- end
- local Use = Instance.new("TextButton",script.Parent.ItemClick)
- Use.Name = "Use"
- Use.Text = "Use"
- Use.Size = UDim2.new(0,100,0,25)
- Use.Position = UDim2.new(0,0,0,25*ItemFrameAmount)
- ItemFrameAmount = ItemFrameAmount + 1
- local Examine = Instance.new("TextButton",script.Parent.ItemClick)
- Examine.Name = "Examine"
- Examine.Text = "Examine"
- Examine.Size = UDim2.new(0,100,0,25)
- Examine.Position = UDim2.new(0,0,0,25*ItemFrameAmount)
- ItemFrameAmount = ItemFrameAmount + 1
- local Drop = Instance.new("TextButton",script.Parent.ItemClick)
- Drop.Name = "Drop"
- Drop.Text = "Drop"
- Drop.Size = UDim2.new(0,100,0,25)
- Drop.Position = UDim2.new(0,0,0,25*ItemFrameAmount)
- script.Parent.ItemClick.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
- Frame.Size = UDim2.new(0,100,0,25*ItemFrameAmount)
- wait(0.5)
- ItemFrameAmount = 0
- debounce = false
- end)
- end
- v.ItemButton.MouseButton1Down:connect(function()
- if debounce == true then return end
- debounce = true
- print("LeftClicked")
- wait(0.5)
- debounce = false
- end)
- end
- if ItemClickScan >= MaxScan then
- ItemClickScan = 0
- end
- end
- wait(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment