--// Varibles \\--
local repStorage = game:GetService("ReplicatedStorage")
local ActivateKaguneEvent = repStorage:WaitForChild("ActivateKakune")
local function ActivateKagune(plr)
local HumanoidRootpart = plr.Character
local NewKagune = Instance.new("Part",workspace)
NewKagune.BrickColor = BrickColor.new("Really red")
NewKagune.Anchored = false
NewKagune.CanCollide = true
NewKagune.Position = Vector3.new(0,2,0.5)
local NewWereld = Instance.new("WeldConstraint",NewKagune)
NewWereld.Part1 = HumanoidRootpart
NewWereld.Part0 = NewKagune
end
ActivateKaguneEvent.OnServerEvent:Connect(ActivateKagune)
COMMUNITY QUESTION
I am creating a wereld constaint but the part1 and part0 wont work how to fix this issue?
1 answer
Problem:
- You made the weld's
Part1a model. It has to be a part.
Solution:
- Change the
HumanoidRootpartvariable toplr.Character.HumanoidRootPartas it actually is theHumanoidRootPart.
Recommendations:
- Don't use the second argument of
Instance.new()as it is inefficient and slow. Instead, set the parent by doingPart.Parent = parent.
Fixed Script:
--// Varibles \\--
local repStorage = game:GetService("ReplicatedStorage")
local ActivateKaguneEvent = repStorage:WaitForChild("ActivateKakune")
local function ActivateKagune(plr)
local HumanoidRootpart = plr.Character.HumanoidRootPart
local NewKagune = Instance.new("Part")
NewKagune.BrickColor = BrickColor.new("Really red")
NewKagune.Anchored = false
NewKagune.CanCollide = true
NewKagune.Position = Vector3.new(0,2,0.5)
NewKagune.Parent = workspace
local NewWereld = Instance.new("WeldConstraint")
NewWereld.Part1 = HumanoidRootpart
NewWereld.Part0 = NewKagune
NewWereld.Parent = NewKagune
end
ActivateKaguneEvent.OnServerEvent:Connect(ActivateKagune)
This discussion is preserved as it was. New answers, comments, and votes are closed.
