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

How to make this sword script work with FilteringEnabled?

Asked by 4 years ago

I'm not used to working with FilteringEnabled. This script inserts a sword into the player's hand and welds it. The sword doesn't show up on the server side so how do I fix this?

local playerHand = script.Parent.RightHand
local swordVar = script.Parent.SwordType
local item1 = game.ReplicatedStorage.Swords:FindFirstChild(swordVar.Value)
local anim = game.ReplicatedStorage.slash

local newItem = item1:Clone()
newItem.Parent = playerHand.Parent
newItem.posPart.Transparency = 1
newItem.Hitbox.Transparency = 1
newItem:SetPrimaryPartCFrame(CFrame.new(playerHand.Position))

local newAnim = anim:Clone()
newAnim.Parent = playerHand.Parent

local connect = Instance.new("Motor6D")
connect.Name = "WeldToHand"
connect.Parent = newItem.posPart
connect.Part0 = newItem.posPart
connect.Part1 = playerHand
0
we are going to need more information. Does the script fire when a character respawns? Or maybe when they press a key? Despayr 505 — 4y
0
@Despayr The script fires 5 seconds after the player spawns/respawns. Starflyerz 44 — 4y
0
Is the player holding a sword as a tool or is it an individual thing? voidofdeathfire 148 — 4y

Answer this question