So I'm making a weapon that has the handle welded to your hand. I made this remote event that doesn't seem to work.
local remotes = script.Parent remotes.EquipRapier.OnServerEvent:connect(function(LocalPlayer) local WeldedHand = LocalPlayer.Character.RightHand local Rapier = game:GetService("ReplicatedStorage").Rapier:Clone() local Handle = Rapier.Handle local Weld = Instance.new("Weld",WeldedHand) Weld.Part0 = WeldedHand Weld.Part1 = Handle end)
It doesn't seem to clone anything, for when I check workspace, nothing shows up. Even when I directly type game.Workspace.Rapier:Clone()
into command bar while testing,
nothing shows up. It isn't a name issue, nor is it me calling the remote incorrectly. There are no arguments for the client to call anyways.
If you could help, that would be great. Thanks.
Hello there, i'll try to explain as much as i could.
Do not use:
local weld = Instance.new("Weld", <Parent>)
Use:
local weld = Instance.new("Weld")
weld.Part0 = <Part0>
weld.Part1 = <Part1>
weld.Parent = <Parent>
As this is Deprecated:
local Weld = Instance.new("Weld",WeldedHand)
which means it has delay Creating the weld, and the rest of the code is running, it can't set the properties if the weld isn't created at the first place.
And for the reason it isn't working now:
On line 08: any instance that is a clone, the user has to set a parent to it, it is not showing because the cloned part is waiting for a parent
You'll have to add this line;
Rapier.Parent = workspace --Change workspace to any parent you want
Hope this helped.