Equip button adds both my scripts

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    To not make both functions add

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I couldnt find any
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
    Both are local scripts

--local script 1
--Variables
local Game = game
local open = false
local sp = script.Parent
local sps = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify").GearFrame.GearLabel
local spss = Game:GetService("ReplicatedStorage"):WaitForChild("Items")["RainbowMagicCarpet"]
local spsss = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify").GearFrame.Equip
local spssss = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify").GearFrame.ItemName
local FRemote = Game:GetService("ReplicatedStorage"):WaitForChild("GiveGear")
local Frame = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify")


--Functions
spsss.MouseButton1Click:Connect(function()
   if open then
print("Remote Fired")	
		FRemote:FireServer("Remove Gear","RainbowMagicCarpet")
        open = false
		spsss.Text = ("Equip")
		spsss.BackgroundColor3 = Color3.new(85/255, 255/255, 127/255)
	else
		print("Remote Fired")	
		FRemote:FireServer("Giver Gear","RainbowMagicCarpet")
		open = true
		spsss.Text = ("Unequip")
		spsss.BackgroundColor3 = Color3.new(226/255, 0/255,40/255)
	end
end)
sp.MouseButton1Click:Connect(function()
	Frame.Visible = true
	sps.Image = spss.TextureId
	spssss.Text = ("RainbowMagicCarpet")
end)

-- local script 2
--Variables

local open = false
local sp = script.Parent
local Game = game
local sps = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify").GearFrame.GearLabel
local spss = Game:GetService("ReplicatedStorage"):WaitForChild("Items")["CrescendoTheSoulStealer"]
local spsss = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify").GearFrame.Equip
local FRemote = Game:GetService("ReplicatedStorage"):WaitForChild("GiveGear")
local spssssss = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify").GearFrame.ItemName
local Frame = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify")


--Functions
spsss.MouseButton1Click:Connect(function()
	if open then
		print("Remote Fired")	
		FRemote:FireServer("Remove Gear","CrescendoTheSoulStealer")
		open = false
		spsss.Text = ("Equip")
		spsss.BackgroundColor3 = Color3.new(85/255, 255/255, 127/255)
	else
		print("Remote Fired")	
		FRemote:FireServer("Giver Gear","CrescendoTheSoulStealer")
		open = true
		spsss.Text = ("Unequip")
		spsss.BackgroundColor3 = Color3.new(226/255, 0/255,40/255)
	end
end)
sp.MouseButton1Click:Connect(function()
	Frame.Visible = true
	sps.Image = spss.TextureId
	spssssss.Text = ("CrescendoTheSoulStealer")
end)



Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

I don’t understand the problem is the equip/unequipped getting a different tool?
Can you explain the problem the only problem I saw is that you got different tool.

1 Like

okay one tool is supposed to equip 1 the other cant unless that frame is clicked on

1 Like

wait hold on that video is incorrect let me change it real quick

1 Like

Oh the problem is when you pressed the unequipped both tool’s got removed.

1 Like

the promblem is that 1 tool should equip and unequip, both should not appear only one

1 Like

Can you show me the script for the remote event server script.

1 Like

? those are the only scripts that are the promblem the one in sss or serverscriptservice should be fine

1 Like

oh i seee what you mean

spsss.MouseButton1Click:Connect(function()
	if open then
		print("Remote Fired")	
		FRemote:FireServer("Remove Gear","CrescendoTheSoulStealer")
		open = false
		spsss.Text = ("Equip")
		spsss.BackgroundColor3 = Color3.new(85/255, 255/255, 127/255)
	else
		print("Remote Fired")	
		FRemote:FireServer("Giver Gear","CrescendoTheSoulStealer")
		open = true
		spsss.Text = ("Unequip")
		spsss.BackgroundColor3 = Color3.new(226/255, 0/255,40/255)
	end
end)
sp.MouseButton1Click:Connect(function()
	Frame.Visible = true
	sps.Image = spss.TextureId
	spssssss.Text = ("CrescendoTheSoulStealer")
end)

the other one is

--Functions
spsss.MouseButton1Click:Connect(function()
   if open then
print("Remote Fired")	
		FRemote:FireServer("Remove Gear","RainbowMagicCarpet")
        open = false
		spsss.Text = ("Equip")
		spsss.BackgroundColor3 = Color3.new(85/255, 255/255, 127/255)
	else
		print("Remote Fired")	
		FRemote:FireServer("Giver Gear","RainbowMagicCarpet")
		open = true
		spsss.Text = ("Unequip")
		spsss.BackgroundColor3 = Color3.new(226/255, 0/255,40/255)
	end
end)
sp.MouseButton1Click:Connect(function()
	Frame.Visible = true
	sps.Image = spss.TextureId
	spssss.Text = ("RainbowMagicCarpet")
end)


The reason why I want to see the server script for the remote event is because that is where you remove the tools and add tools. I don’t really see the problem for the local script it.

2 Likes

if you would like to see the variables they both have the same variables


--Variables
local Game = game
local open = false
local sp = script.Parent
local sps = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify").GearFrame.GearLabel
local spss = Game:GetService("ReplicatedStorage"):WaitForChild("Items")["RainbowMagicCarpet"]
local spsss = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify").GearFrame.Equip
local spssss = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify").GearFrame.ItemName
local FRemote = Game:GetService("ReplicatedStorage"):WaitForChild("GiveGear")
local Frame = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Roundify")

the promblem is the equip button or i think idk im a bit new to scripting

1 Like

Yeah still don’t see the problem, can you print the out put of the server script service:
print(plr, argument1, argument2)

1 Like

both of the scripts are using the same equip button for unequip and equipping the weapons so both functions are added?

1 Like

where would i put that line exactly?

1 Like

Just ss the out put or copy it just paste it here.

1 Like

willl do

local repRemote = game:GetService("ReplicatedStorage")
local repStorage = game:GetService("ReplicatedStorage")
local items = repStorage.Items
local remote = repRemote.GiveGear
local Table = {}

remote.OnServerEvent:Connect(function(plr, Message, item)
	if Message == "Giver Gear" and item then
		items[item]:Clone().Parent = plr.Backpack
		items[item]:Clone().Parent = plr.StarterGear
	elseif Message == "Remove Gear" and plr.Backpack:FindFirstChild(item) then
		plr.StarterGear[item]:Destroy()
		plr.Backpack[item]:Destroy()
end
end) 

i dont think anythings wrong with it

Hmm so can you add print and check if there is a problem with the FireServer()