Advance Melee System not working

Hey so I made a post before going over not being able to add the tool into backpack as a model. This has since been fixed I ended up figuring it out myself. So everything works, the model pops up in the UI backpack and inventory I can save it all, Now my issue is with the Advance Melee System, now that I have changed it over to my UI scripts the Advance melee system isn’t registering or playing the animations for the model…

Advanced Melee System with inventory helpppp2.rbxl (670.4 KB)

I’ve been at this for over 4 days now, and it’s really putting a stump in my development. If someone would do kind as to get this working for me, or instruct me on how to do so. I’m really struggling here. I tried to insert the scripts I’m using in my other post but came to no solution.

So here is the whole system that you can put into studio, with all the scripts… if someone could help make this work. I would be very appreciative.

1 Like

I can attach the working system as well if need be.

You have an error on line 24 of the LocalScript.

It cannot find the groups[teamName].

2 Likes

Question: Do you own the animations you are trying to play; did you publish them yourself?

Yeah that’s a separate thing doesn’t have to do with the system, it’s not like that in my game and I do own the animations myself.

The file you uploaded doesn’t work, so it makes it hard to see what you are saying.

1 Like

I will send you the one that does work give me a couple minutes.

Okay so this is the working advance melee system, however, doesn’t quite do what I want it to do. If you pick up the sword and equip it through the inventory the system doesn’t work. But if you select the tool through the gui and press the tool that pops up in the new toolbar then the advance system works. I just want someone to be able to pick up the tool put it into their inventory, equip the tool, and have the advance system work. I dont want people to have to press the gui for their tool to be spawned.
Advanced Melee System with inventory helpppp3.rbxl (676.3 KB)

in this version the bow comes up in the gui, and doesnt appear broken in workspace but throws an error that Im unable to fix.
Advanced Melee System with inventory helpppp4.rbxl (679.0 KB)

Anyone got any solutions?? I keep trying different things all without being able to achieve my goal. Same errors.

Any ideas lol??? I don’t even know where to begin with this one in converting it.

I still get the same error I got before.

So, I am not certain if it is part of the problem. Sometimes one problem can stop eveything else from working.

When I clicked around I got a wall of errors:

The ones that catch my eye are about the Sanitied ID. I think that means the animations are either waiting for approval or have been deleted (or that I simply am not allowed to load them).

Let me see if I can give you permission to load them, and the other error is just because there are no teams in the game if you remove the team changer gui it will remove the nil issue.

I’m pretty sure the issue your having is because you aren’t allowed to load the animations that aren’t yours you would have to publish the animations to Roblox and change the ids yourself or I could show you a video of what it does and what I mean.

What happens if you change the Animation ID to be a standard Roblox ID.

That way you can figure out of it is your actual animation, or if it is a script error.

At least you could eliminate one question.

robloxapp-20240404-0022290.wmv (4.8 MB)

This is what it looks like for me.

I pretty much need this script to find my other backpack UI

-- Compiled with roblox-ts v1.2.7
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("AMS-rbxts_include"):WaitForChild("RuntimeLib"))
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
local _flipper = TS.import(script, TS.getModule(script, "@rbxts", "flipper").src)
local Instant = _flipper.Instant
local Spring = _flipper.Spring
local _FlipperUtil = TS.import(script, script.Parent, "FlipperUtil")
local UseGroupFlipper = _FlipperUtil.UseGroupFlipper
local UseSingleFlipper = _FlipperUtil.UseSingleFlipper
local Janitor = TS.import(script, TS.getModule(script, "@rbxts", "janitor").src).Janitor
local Events = TS.import(script, script.Parent.Parent, "events").Events
local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
local params = {
	dampingRatio = 0.7,
	frequency = 4,
}
local Numerals = { "I", "II", "III", "IV", "V", "VI", "VII", "IIX", "IX" }
local function handleTransparency(transp)
	return function(val)
		local diff = 1 - transp
		return (1 - val) * diff + transp
	end
end
local Toolbox
do
	Toolbox = Roact.Component:extend("Toolbox")
	function Toolbox:init(props)
		self.janitor = Janitor.new()
		self.status = false
		self.Name = Roact.createRef()
		self.ViewportFrame = Roact.createRef()
		local _binding = UseGroupFlipper({
			X = 0.107,
			Y = 0.094,
		})
		self.posMotor = _binding[1]
		self.posBinding = _binding[2]
		self.posSetBinding = _binding[3]
		local _binding_1 = UseSingleFlipper(0)
		self.enabledMotor = _binding_1[1]
		self.enabledBinding = _binding_1[2]
		self.enabledSetBinding = _binding_1[3]
		local _binding_2 = UseSingleFlipper(1)
		self.visibleMotor = _binding_2[1]
		self.visibleBinding = _binding_2[2]
		self.visibleSetBinding = _binding_2[3]
	end
	function Toolbox:didUpdate()
		self.status = self.props.status
		self:UpdateEnabled()
	end
	function Toolbox:didMount()
		self.status = self.props.status
		self:UpdateEnabled()
		self.janitor:Add(Events.ToolToggled:connect(function(id, state)
			if id ~= self.props.id then
				return nil
			end
			repeat
				if state == "Disabled" then
					self.status = false
					break
				end
				if state == "Enabled" then
					self.status = true
					break
				end
			until true
			self:UpdateEnabled()
		end))
	end
	function Toolbox:UpdateEnabled()
		local _exp = self.status
		repeat
			if _exp == false then
				self.enabledMotor:setGoal(Spring.new(0, params))
				return nil
			end
			if _exp == true then
				self.enabledMotor:setGoal(Spring.new(1, params))
				return nil
			end
		until true
	end
	function Toolbox:willUnmount()
		self.janitor:Cleanup()
	end
	function Toolbox:render()
		local _exp = self.props.animation.type
		repeat
			if _exp == "FADE" then
				local pos = self.props.animation.pos
				self.posMotor:setGoal({
					X = Instant.new(pos.X.Scale),
					Y = Instant.new(pos.Y.Scale),
				})
				self.visibleMotor:setGoal(Instant.new(0))
				self.visibleMotor:setGoal(Spring.new(1, params))
				break
			end
			if _exp == "MOVE" then
				local pos1 = self.props.animation.pos1
				local pos2 = self.props.animation.pos2
				self.posMotor:setGoal({
					X = Instant.new(pos1.X.Scale),
					Y = Instant.new(pos1.Y.Scale),
				})
				self.posMotor:setGoal({
					X = Spring.new(pos2.X.Scale, params),
					Y = Spring.new(pos2.Y.Scale, params),
				})
				break
			end
		until true
		return Roact.createElement("ImageButton", {
			Image = nil,
			BackgroundColor3 = Color3.fromRGB(0, 0, 0),
			BackgroundTransparency = self.visibleBinding:map(handleTransparency(0.95)),
			AnchorPoint = Vector2.new(0.5, 0.5),
			Position = self.posBinding:map(function(val)
				return UDim2.fromScale(val.X, val.Y)
			end),
			Size = UDim2.new(0.029 * 1.25, 0, 0.052 * 1.25, 0),
			[Roact.Event.MouseButton1Click] = function()
				if UserInputService.MouseEnabled then
					self:Clicked()
				end
			end,
			[Roact.Event.TouchTap] = function()
				if UserInputService.TouchEnabled then
					self:Clicked()
				end
			end,
		}, {
			Roact.createElement("UIAspectRatioConstraint", {
				AspectRatio = 1,
			}),
			Roact.createElement("Frame", {
				BackgroundColor3 = Color3.fromRGB(0, 0, 0),
				BackgroundTransparency = self.enabledBinding:map(handleTransparency(0.85)),
				AnchorPoint = Vector2.new(0.5, 0.5),
				Position = UDim2.fromScale(0.5, 0.5),
				Size = UDim2.fromScale(1, 1),
			}, {
				Roact.createElement("UICorner", {
					CornerRadius = UDim.new(100, 0),
				}),
			}),
			Roact.createElement("UICorner", {
				CornerRadius = UDim.new(100, 0),
			}),
			Numeral = Roact.createElement("TextLabel", {
				BackgroundTransparency = 1,
				Font = Enum.Font.Fantasy,
				AnchorPoint = Vector2.new(0.5, 0.5),
				Position = UDim2.fromScale(0.5, 0.5),
				RichText = true,
				Size = UDim2.new(0.768, 0, 0.804, 0),
				Text = Numerals[self.props.position - 1 + 1],
				TextColor3 = Color3.fromRGB(255, 255, 255),
				TextScaled = true,
				TextSize = 14,
				TextTransparency = self.visibleBinding:map(handleTransparency(0.8)),
				TextWrapped = true,
			}),
			Name = Roact.createElement("TextLabel", {
				[Roact.Ref] = self.Name,
				BackgroundTransparency = 1,
				Font = Enum.Font.Fantasy,
				Position = UDim2.new(0.107, 0, 0.219, 0),
				RichText = true,
				Size = UDim2.new(0.768, 0, 0.5, 0),
				Text = self.props.tool.Name,
				TextColor3 = Color3.fromRGB(255, 255, 255),
				TextScaled = true,
				TextSize = 14,
				TextTransparency = self.visibleBinding:map(handleTransparency(0.3)),
				TextWrapped = true,
			}),
			Roact.createElement("ViewportFrame", {
				[Roact.Ref] = self.ViewportFrame,
				BackgroundTransparency = 1,
				ImageTransparency = self.visibleBinding,
				Position = UDim2.new(0.036, 0, 0.036, 0),
				Size = UDim2.new(0.036, 0, 0.036, 0),
			}),
		})
	end
	function Toolbox:Clicked()
		Events.Input({
			type = "PARSED",
			State = "End",
			Input = self.props.tool:GetAttribute("BUTTON_TOGGLE"),
		})
	end
end
return {
	Toolbox = Toolbox,
}

and this one these can be found under PlayerStarterScripts, AMS-Client, modules… and they are the tool scripts that I need converted to my backpack UI… So when i select inventory and equip the tool, the tool is found in the new backpack ui instead of the one the script makes.

-- Compiled with roblox-ts v1.2.7
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("AMS-rbxts_include"):WaitForChild("RuntimeLib"))
local Object = TS.import(script, TS.getModule(script, "@rbxts", "object-utils"))
local Roact = TS.import(script, TS.getModule(script, "@rbxts", "roact").src)
local Toolbox = TS.import(script, script.Parent, "Toolbox").Toolbox
local Players = TS.import(script, TS.getModule(script, "@rbxts", "services")).Players
local BasePosition = UDim2.new(0.5, 0, 0.95, 0)
local XSpacing = 0.05
local Equipped = TS.import(script, script.Parent, "Equipped").Equipped
local Player = Players.LocalPlayer
local Toolbar
do
	Toolbar = Roact.Component:extend("Toolbar")
	function Toolbar:init()
		self.prevButtonPositions = {}
		self.total = 0
	end
	function Toolbar:render()
		local Elements = {}
		local ids = Object.keys(self.props)
		self.total = #ids
		for _, id in ipairs(ids) do
			if id == Roact.Children then
				return nil
			end
			local value = self.props[id]
			if value == nil then
				error()
			end
			if not (type(value) == "table") then
				continue
			end
			local animation
			local newPos
			if value.previousButton == nil then
				newPos = self:getPositionFromNumber(value.button)
				animation = {
					type = "FADE",
					pos = newPos,
				}
			else
				local prevPos = self.prevButtonPositions[value.previousButton]
				newPos = self:getPositionFromNumber(value.button)
				if not prevPos then
					prevPos = newPos
				end
				animation = {
					type = "MOVE",
					pos1 = prevPos,
					pos2 = newPos,
				}
			end
			self.prevButtonPositions[value.button] = newPos
			if type(id) == "number" then
				error("something went wrong")
			end
			local _arg0 = Roact.createElement(Toolbox, {
				id = id,
				status = Equipped[id],
				tool = value.tool,
				position = value.button,
				animation = animation,
			})
			-- ▼ Array.push ▼
			Elements[#Elements + 1] = _arg0
			-- ▲ Array.push ▲
		end
		local _arg0 = Roact.createElement("TextLabel", {
			Text = tostring(#Object.keys(self.props)),
		})
		-- ▼ Array.push ▼
		Elements[#Elements + 1] = _arg0
		-- ▲ Array.push ▲
		local _attributes = {
			ResetOnSpawn = false,
		}
		local _children = {}
		local _length = #_children
		for _k, _v in ipairs(Elements) do
			_children[_length + _k] = _v
		end
		return Roact.createElement("ScreenGui", _attributes, _children)
	end
	function Toolbar:getPositionFromNumber(n)
		local NewUDim2 = UDim2.fromScale(BasePosition.X.Scale + -((self.total - 1) * XSpacing) / 2 + (n - 1) * XSpacing, BasePosition.Y.Scale)
		return NewUDim2
	end
end
return {
	Toolbar = Toolbar,

5 days now no solution… can anybody give insight?

@DevInfinitum

You have a lot of scripts in the file you sent. Not knowing one from the other it is hard to figure out the problem for you.

I have had times like you are having. Where I have spent countless hours trying to solve a code problem.

Finally, I figured out a better way.

Now I write code with print statement built in from the beginning.

I add a debug bool inside the script and toggle it on or off to show the print statements when I want to figure a problem.

It is handy when you are building a complex GUI.

I think you might need to go through your code and start adding some print statements and warnings. Here is a sample of how I build the print and warning statements into a block of code:

local function CheckItem(item)
	if Debug then print("CHECK ITEM | Started...") end

	if CurrentTool.Value == item.Name then
		if Debug then print("CHECK ITEM | CURRENT TOOL | Match Found", item.Name) end

		if Status.Value == "Equipped" then
			if Debug then print("CHECK ITEM | CURRENT TOOL | STATUS | Equipped") end

			-- do something if tequipped

		end

		if Status.Value == "Stowed" then
			if Debug then print("CHECK ITEM | CURRENT TOOL | STATUS | Stowed") end

			-- do something if stowed

		end

	else
		if Debug then warn("CHECK ITEM | CURRENT TOOL | No match found for", item.Name) end
	end

	if Debug then print("CHECK ITEM | ...Ended") end
end