Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is the sword not cloning to the backpack after the remote event is fired?

Asked by 3 years ago

So i made a menu that is supposed to clone a sword to the players' backpack after they forge it but its not working. I tried it as a local script but those dont affect the server so the sword didnt do anything because it was cloned locally. So i tried using a remote event and the event fired but to player doesnt get the sword, can anybody help me? LOCAL SCRIPT

local forge = script.Parent
local db = true

forge.MouseButton1Click:Connect(function(player)
if db == true then  
script.Parent.DNB:FireServer(player)
db = false
wait(10)
db = true
end
end)

SERVER SCRIPT TO CLONE SWORD

script.Parent.DNB.OnServerEvent:Connect(function(player)
    local light = game:GetService("ServerStorage")
    local db = true
local fc = player.ForgeryCoins.ForgeryCoins
if fc.Value >= 20 and db == true then
fc.Value = fc.Value - 20
local prize = light.DNB:Clone()
prize.Parent = player.Backpack
prize.Parent = player.StarterGear
db = false
script.Parent.Text = "Cooldown"
script.Parent.Round.ImageColor3 = Color3.fromRGB(85,85,85)
wait(10)
script.Parent.Round.ImageColor3 = Color3.fromRGB(0,255,127)
script.Parent.Text = "FORGE"
db = true
end
if fc.Value < 20 and db == true then
script.Parent.Round.ImageColor3 = Color3.fromRGB(255,0,0)
script.Parent.Text = "Not Enough Forgery Coins!"
db = false
wait(1.5)
script.Parent.Round.ImageColor3 = Color3.fromRGB(0,255,127)
script.Parent.Text = "FORGE"
db = true
end
end)
0
is the server script in serverscriptstorage? ryanaskew 50 — 3y
0
bruh its not its inside a gui HappyTimIsHim 652 — 3y
0
ur setting prize parent to starter gear right after its in backpack so just make another clone HappyTimIsHim 652 — 3y

Answer this question