Ad
Log in to vote
0

My Object is not cloning but no errors occur. What have I done wrong in my script? [SOLVED]

Asked by 14 days ago
Edited 14 days ago

Object is not cloning but no errors occur. It just doesn’t clone anything.

function TestService:Spawn(Player, Weapon)
    if Weapon ~= Items.IDArray[Weapon] then
        game.ReplicatedStorage.SuccessMessage:FireClient(Player, "? Successfully found "..Weapon.." with ID "..Items.IDArray[Weapon].ID)

        -- Welding
        local Weapon = game.ReplicatedStorage[Weapon]
        local Clone = Weapon:Clone()
        Clone. Parent = game.Workspace
        local WeldC0 = Instance.new("Weld", Clone.Model.Handle)
        local WeldC1 = Instance.new("Weld")
        WeldC0.Name = "WeldC0" 
        WeldC1.Name = "WeldC1"
    else
        game.ReplicatedStorage.ErrorMessage:FireClient(Player, "? Sorry, I couldn't find "..Weapon.." in my Array!")
    end
end

2 answers

Log in to vote
1
Answered by 14 days ago
 Clone.Parent = game.Workspace
-- :D
0
Sadly, that did nothing. iiMxtt_Destinyii 58 — 14d
0
Sadly, that did nothing. iiMxtt_Destinyii 58 — 14d
0
Sorry, lag. iiMxtt_Destinyii 58 — 14d
0
Also, that space isn't in Studio. It's the websites formatting. iiMxtt_Destinyii 58 — 14d
0
I'll mark your answer anyway. iiMxtt_Destinyii 58 — 14d
Ad
Log in to vote
0
Answered by 14 days ago

I've managed to solve my own problem, I'll go ahead and edit my title to solved. I simply added a Fake variable followed by the model location then added a clone statement and then it worked:

function TestService:Spawn(Player, Weapon)
    if Weapon ~= Items.IDArray[Weapon] then
        game.ReplicatedStorage.SuccessMessage:FireClient(Player, "? Successfully found " .. Weapon .. " with ID " .. Items.IDArray[Weapon].ID)

        -- Welding
        local WeaponSaid = game.ReplicatedStorage[Weapon]
        local Fake = WeaponSaid:Clone()
        Fake.Parent = game.Workspace
        local WeldC0 = Instance.new("Weld", WeaponSaid.Model.Handle)
        local WeldC1 = Instance.new("Weld")
        WeldC0.Name = "WeldC0"
        WeldC1.Name = "WeldC1"
    else
        game.ReplicatedStorage.ErrorMessage:FireClient(Player, "? Sorry, I couldn't find " .. Weapon .. " in my Array!")
    end
end

A similar answer to the person above but, they seemed to miss that I already added that to my script. Thanks for the support anyway.

Answer this question