Roblox Item Funktioniert nicht wie es soll?

Hey ich Programmiere zurzeit ein Roblox Simulator und bin dabei einen Shop für Items zu machen (GUI) es funktioniert alles gut außer dass wenn ich mir das Standard Schwert nehme (Bisherr das einzigste) Die Swings nicht sellen kann und es anderen Spielern nicht angezeigt werden(Meine Swings) Es funktioniert mit Dem Selbem Schwert im StarterPack , aber nicht wenn ich über ReplicatedStorage zugreifen möchte (Mit einem LocalScript funktionierts im ReplicatedStorage nur dann wird es den Mitspielern nicht angezeigt) Code :

Script fürs Schwert was ich aus dem Shop holen möchte:

local db = false
local tool = script.Parent
repeat wait() until tool.Parent.Parent:IsA("Player")
local plr = tool.Parent.Parent
local character = plr.Character

tool.Activated:Connect(function()

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 9443776) then if not db then plr.leaderstats.Swings.Value = plr.leaderstats.Swings.Value + 1

db = true wait(0.250) db = false end else if not db then plr.leaderstats.Swings.Value = plr.leaderstats.Swings.Value + 1

db = true wait(0.500) db = false end end end)

local Part = game.Workspace.Sell Part.Touched:Connect(function(hit) local H = hit.Parent:FindFirstChild("Humanoid") if H then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then local leaderstats = player:WaitForChild("leaderstats") local Currency = leaderstats.Gold local Selling = leaderstats.Swings if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 9398856) then

if Selling.Value > 0 then
Currency.Value = Currency.Value + Selling.Value *2
Selling.Value = 0
end
else
if Selling.Value > 0 then
Currency.Value = Currency.Value + Selling.Value *1
Selling.Value = 0
end
end
end
end
end)

Standart Schwert im StarterPack:

local db = false
local tool = script.Parent
repeat wait() until tool.Parent.Parent:IsA("Player")
local plr = tool.Parent.Parent
local character = plr.Character

tool.Activated:Connect(function()

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 9443776) then if not db then plr.leaderstats.Swings.Value = plr.leaderstats.Swings.Value + 1

db = true wait(0.250) db = false end else if not db then plr.leaderstats.Swings.Value = plr.leaderstats.Swings.Value + 1

db = true wait(0.500) db = false end end end)

local Part = game.Workspace.Sell Part.Touched:Connect(function(hit) local H = hit.Parent:FindFirstChild("Humanoid") if H then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then local leaderstats = player:WaitForChild("leaderstats") local Currency = leaderstats.Gold local Selling = leaderstats.Swings if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 9398856) then

if Selling.Value > 0 then
Currency.Value = Currency.Value + Selling.Value 2 Selling.Value = 0 end else if Selling.Value > 0 then Currency.Value = Currency.Value + Selling.Value 1 Selling.Value = 0 end end end end end) 

Das Letzte Script kommt in hier drunter

...zum Beitrag

Equip Button Script (Local Script) player = game.Players.LocalPlayer

Bttn = script.Parent

local backpack = player:WaitForChild("Backpack")

local character = player.Character or player.CharacterAdded:Wait()

local function purgeLaunchers(container)

for _, item in pairs(container:GetChildren()) do

if item:IsA("Tool") and item.Name:match("EiRon")or item.Name:match ("EisenSword") then

item:Destroy()

end

end

end

script.Parent.MouseButton1Click:Connect(function()

purgeLaunchers(backpack)

purgeLaunchers(character)

local cloneTool = game.ReplicatedStorage.EisenSword:Clone()

cloneTool.Parent = backpack

end)

...zur Antwort

Sag ihr das du nur das Beste für sie wolltest ! Und wenn sie es nicht versteht lass ihr zeit :) Viel Glück

...zur Antwort