Script breaking

What is wrong with this script, the particles keep going so far

local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassId = 16558561
game.Players.PlayerAdded:Connect(function(player)
	print("PLayer added")
	player.CharacterAdded:Wait()
	print("Character added")
	if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassId) then 
		print("Owns Pass")
		local particles = game.ReplicatedStorage.lightning:Clone()
		particles.Parent = player.Character.HumanoidRootPart
		local weld = Instance.new("WeldConstraint")
		weld.Parent = player.Character
		weld.Part0 = particles
		weld.Part1 = player.Character.UpperTorso
	end
end)
1 Like

so about how big do you want it?

1 Like

particles.Size = Vector3.new(4.217, 5.725, 2.479)

1 Like

Simple fix:

local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassId = 16558561
game.Players.PlayerAdded:Connect(function(player)
	print("Player added")
	player.CharacterAdded:Wait()
	print("Character added")
	if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassId) then 
		print("Owns Pass")
		local particles = game.ReplicatedStorage.lightning:Clone()
		particles.Parent = player.Character.HumanoidRootPart
		particles.Position = player.Character.HumanoidRootPart.Position
		local weld = Instance.new("WeldConstraint")
		weld.Parent = player.Character
		weld.Part0 = particles
		weld.Part1 = player.Character.UpperTorso
	end
end)

This happened because you never set the position, so it welded the part far away from the character.

Edit: You can change this line to the part you wish it to be visibly attached to.

particles.Position = player.Character.HumanoidRootPart.Position -- change this part if needed