Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Variables //--
- local PhysicsService = game:GetService("PhysicsService")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Player = game:GetService("Players").LocalPlayer
- local UIS = game:GetService("UserInputService")
- local TS = game:GetService("TweenService")
- local Template = ReplicatedStorage.Storage.SlotTemplate
- local ClassModule = ReplicatedStorage.Modules.DataList
- local Modules = ReplicatedStorage.Modules
- local Red = require(Modules.Red)
- local CharacterNet = Red.Client("CharacterNet")
- local CooldownNet = Red.Client("Cooldown")
- local AcceptableNames = {"One", "Two", "Three", "Four"}
- local Conversion = {["One"] = "1", ["Two"] = "2", ["Three"] = "3", ["Four"] = "4"}
- local keybindPress = function(key)
- CharacterNet:Fire("UseMove", {
- key;
- })
- end
- --[[
- for index, value in do
- if index == Player:FindFirstChild("Class").Value then
- task.wait(1)
- local currentClassModule = value
- for i, slot in currentClassModule.Movesets do
- if table.find(AcceptableNames, i) then
- local newSlot = Template:Clone()
- newSlot.LayoutOrder = tonumber(Conversion[i])
- newSlot.Parent = script.Parent.Hotbar.ContainerSlots
- newSlot.HotbarHitbox.SlotName.Text = currentClassModule.Movesets[i].name
- newSlot.HotbarHitbox.SlotNumber.Text = Conversion[i]
- newSlot.HotbarHitbox.MouseButton1Down:Connect(function()
- keybindPress(i)
- end)
- end
- end
- end
- end
- ]]
- for index, key in AcceptableNames do
- UIS.InputBegan:Connect(function(input, gp)
- if gp then return end
- if input.KeyCode == Enum.KeyCode[key] then
- keybindPress(key)
- end
- end)
- end
- -- Block?
- UIS.InputBegan:Connect(function(input, gp)
- if gp then return end
- if input.KeyCode == Enum.KeyCode.F then
- CharacterNet:Fire("BlockStart")
- end
- end)
- UIS.InputEnded:Connect(function(input, gp)
- if gp then return end
- if input.KeyCode == Enum.KeyCode.F then
- CharacterNet:Fire("BlockEnd")
- end
- end)
- CharacterNet:On("CharacterSet", function(data)
- local currentClassModule = require(ClassModule.CharacterClass)[data]
- for i, frame in script.Parent.Hotbar.ContainerSlots:GetChildren() do
- if frame:IsA("Frame") then
- frame:Destroy()
- end
- end
- for i, slot in currentClassModule.Movesets do
- if table.find(AcceptableNames, i) then
- local newSlot = Template:Clone()
- newSlot.Name = i
- newSlot.LayoutOrder = tonumber(Conversion[i])
- newSlot.Parent = script.Parent.Hotbar.ContainerSlots
- newSlot.HotbarHitbox.SlotName.Text = currentClassModule.Movesets[i].name
- newSlot.HotbarHitbox.SlotNumber.Text = Conversion[i]
- newSlot.HotbarHitbox.MouseButton1Down:Connect(function()
- keybindPress(i)
- end)
- end
- end
- end)
- CooldownNet:On("Cooldown", function(data)
- local slot = script.Parent.Hotbar.ContainerSlots:FindFirstChild(data[1])
- local UIGradient = slot.HotbarHitbox.Cooldown.UIGradient
- UIGradient.Offset = Vector2.new(0, 0)
- print(data[2])
- TS:Create(UIGradient, TweenInfo.new(data[2] + 1.5), {Offset = Vector2.new(0, 1)}):Play()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement