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

How do i create a tool using instance.new on a script?

Asked by 3 years ago

so i want to give the player a sword and then after some time it will get destroyed i tried doing

local Sword = game.Instance.new(ClassicSword, player) and yeah this doesnt work for some reason

how do i get it working

2 answers

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

This is kinda similar to what your asking,

https://devforum.roblox.com/t/cloning-a-tool-and-putting-it-in-a-players-backpack/360256

Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago
local Sword = game.Instance.new(ClassicSword, player) and yeah this doesnt work for some reason

u can clone the sword set the parent of the sword to the serverstorage and clone it from there example

game.Players.PlayerAdded:Connect(function(player)
    local classicsword = game.ServerStorage.ClassicSword
    local cloneofsword = classicsword:Clone()
    cloneofsword.Parent = player.Backpack
end)

set this in a server script i used the playeradded event cause then u can set the parent of the clone to the backpack

Answer this question