Hello! I am here because I have spent some time making a script which allows you to equip a rarity, however, I have nothing equipped when the script finishes. (Yes, the whole script plays through). All help is appreciated!
Local script:
local plr = game.Players.LocalPlayer
local LibraryButton = script.Parent:FindFirstChild("LibraryEnable")
local Library = script.Parent
local LibraryGui = Library.LibraryMain.Frame
local LibraryScroll = LibraryGui.ScrollingFrame
local Rarity = "N/A"
local RepStorage = game:GetService("ReplicatedStorage")
local EquipEvent = RepStorage.EquipRarity
LibraryScroll.Common.TextButton.MouseButton1Click:Connect(function()
Rarity = "Common"
EquipEvent:FireServer(Rarity)
end)
LibraryScroll.Basic.TextButton.MouseButton1Click:Connect(function()
Rarity = "Basic"
EquipEvent:FireServer(Rarity)
end)
LibraryScroll.Uncommon.TextButton.MouseButton1Click:Connect(function()
Rarity = "Uncommon"
EquipEvent:FireServer(Rarity)
end)
LibraryScroll.Rare.TextButton.MouseButton1Click:Connect(function()
Rarity = "Rare"
EquipEvent:FireServer(Rarity)
end)
LibraryScroll.Rare.TextButton.MouseButton1Click:Connect(function()
Rarity = "Rare"
EquipEvent:FireServer(Rarity)
end)
LibraryScroll.Bronze.TextButton.MouseButton1Click:Connect(function()
Rarity = "Bronze"
EquipEvent:FireServer(Rarity)
end)
LibraryScroll.Silver.TextButton.MouseButton1Click:Connect(function()
Rarity = "Silver"
EquipEvent:FireServer(Rarity)
end)
Server Script:
local RepStore = game:GetService("ReplicatedStorage")
local EquipEvent = RepStore.EquipRarity
local ServerStorage = game:GetService("ServerStorage")
local Auras = ServerStorage.Auras
EquipEvent.OnServerEvent:Connect(function(plr, Rarity)
local char = plr.Character
local Attach = Instance.new("Attachment")
Attach.Parent = char.Torso
if Rarity ~= "Common" then
local Aura = Auras:FindFirstChild(Rarity)
local Particles = Aura:GetChildren()
Particles.Parent = char.Torso.Attachment
end
end)
Thank you for reading and maybe helping!