Hi. I was making a sword script and I decided to change it to a server script. My weld script isn't working in server scripts, but is working for local scripts. I don't know why this is, but I do know I can't put it in a local script because then other players couldn't see the sword if I did so. I've been trying to figure this out for 2 hours, but I couldn't find a work around or a bug. In fact, it would be pretty hard to do that when the print at the start doesn't even show up!

-- Server script -- In StarterPack --

local plr = game.Players.PlayerAdded:Wait()
local char = plr.CharacterAdded:Wait() or plr.Character

	print("okok")
	local part = game.ReplicatedStorage.ClassData.Bloxxer.BloxxerSword:Clone()
		part.Name = "BSword"
	local weld = Instance.new("Weld",part)
	print("lets go lets og")
		part.Parent = char
		part.Anchored = false
		part.Massless = true
		weld.Part0 = part --Attach to the handle
		weld.Part1 = char:WaitForChild("RightHand") --Attach to the right hand.
		weld.C0 = CFrame.new(-8, -1, -7) + Vector3.new(0,char["RightHand"].Size.Y/1,0)
		weld.C0 = CFrame.Angles(0,math.rad(180), 140)

Thanks in advance.

2 comments

0

Why are you messing around with welds? Why don't use just use the tool's properties to put it in the player's hand? You should just have a local script inside the tool to handle what the tool does, and a remote event if you need other players to see something.

0

Well, it's a bit complicated, but baisically, the little icon at the botton is annoying me so i rather create my own sword so i can make custom gui