local plr = game.Players.LocalPlayer
local foil = plr.Backpack:FindFirstChild("LinkedSword3").Handle.Mesh
local foil2 = plr.StarterGear:FindFirstChild("LinkedSword3").Handle.Mesh
script.Parent.MouseButton1Click:Connect(function()
if foil.TextureId == ("rbxassetid://2150176816") or foil2.TextureId = ("rbxassetid://2150176816") then
print ("Already Has This Item")
else
if plr.leaderstats.Wins.Value>=5 then
foil.TextureId = ("rbxassetid://2150176816")
foil2.TextureId = ("rbxassetid://2150176816")
else
print ("Does Not Have Enough Wins")
end
end
end)
The Error is "attempt to call a nil value".
The goal is to be a shop that gives sword textures, it only works without the startergear, but you can reset and delete the texture.

1 comment
Does the 'server' script go in server or serverscript storage?