I have this script where if you press on a part then it would give you a weapon. In my case the weapon/tool name is Sandalphon. I have the same thing for a different part but instead when you press it you would get a weapon/tool named Yoshinon. I need help on how I can make it so if I have one tool I can't have the other too and if I currently have Sandalphon then when I press on the other part (Yoshinon Part) it would remove Sandalphon giving me Yoshinon and if so could you include instructions?
local Giver = script.Parent
local Click = Giver:WaitForChild("Click")
local rp = game:GetService("ReplicatedStorage")
Click.MouseClick:Connect(function(player)
local Backpack = player:FindFirstChild("Backpack")
if Backpack then
local Angels = game:GetService("ServerStorage"):WaitForChild("Angels")
local AngelW = Angels.Tohka1:FindFirstChild("Sandalphon"):Clone()
AngelW.Parent = Backpack
Click.MaxActivationDistance = 0
print("You got Tohka's Angel")
local meshes = game.Workspace.JustForTestngPhase.Sandalphon.AngelGiver.Meshes:Clone()
local me = meshes.explosion
local mer = meshes.explosionring2
local mer1 = meshes.explosionring
local mer3 = meshes.explosionring3
meshes.Parent= game.Workspace
me.CFrame = Giver.HumanoidRootPart.CFrame
mer.CFrame = Giver.HumanoidRootPart.CFrame
mer1.CFrame = Giver.HumanoidRootPart.CFrame
mer3.CFrame = Giver.HumanoidRootPart.CFrame
for i = 1,125 do
me.Color = Color3.new(math.random(), math.random(), math.random())
me.Size = me.Size + Vector3.new(2,2,2)
mer.Size = mer.Size + Vector3.new(2,0,2)
mer1.Size = mer1.Size + Vector3.new(2,0,2)
mer3.Size = mer3.Size + Vector3.new(2,0,2)
me.Orientation = me.Orientation + Vector3.new(0,4,0)
mer.Orientation = mer.Orientation + Vector3.new(0,4,0)
mer1.Orientation = mer1.Orientation + Vector3.new(0,4,0)
mer3.Orientation = mer3.Orientation + Vector3.new(0,4,0)
me.Transparency = me.Transparency + 0.01
mer.Transparency = mer.Transparency + 0.01
mer1.Transparency = mer1.Transparency + 0.01
mer3.Transparency = mer3.Transparency + 0.01
wait(0.01)
end
end
Giver:Destroy()
end)

1 comment
Nvm found the answer at least thanks for looking for it.