az2166
(Dream)
January 8, 2023, 2:14pm
#1
local function characterAdded(character : Model)
local primaryPart : BasePart = character:WaitForChild(“HumanoidRootPart”)
local newHitbox = hitbox:Clone()
local weldConstraint : WeldConstraint = Instance.new("WeldConstraint")
weldConstraint.Part0 = newHitbox
weldConstraint.Part1 = primaryPart
weldConstraint.Parent = newHitbox
newHitbox.Position = primaryPart.Position
newHitbox.Parent = character
CLS:AddTag(newHitbox, "Hitbox")
end
local function characterRemoving(character : Model)
character.Hitbox:Destroy()
end
PS.PlayerAdded:Connect(function(player : Player)
playerConnections[player.Name] = {
CharacterAdded = player.CharacterAdded:Connect(characterAdded),
CharacterRemoving = player.CharacterRemoving:Connect(characterRemoving)
}
end)
PS.PlayerRemoving:Connect(function(player : Player)
playerConnections[player.Name].CharacterAdded:Disconnect()
playerConnections[player.Name].CharacterRemoving:Disconnect()
playerConnections[player.Name] = nil
end)
for i,player in pairs (PS:GetPlayers()) do
playerConnections[player.Name] = {
CharacterAdded = player.CharacterAdded:Connect(characterAdded),
CharacterRemoving = player.CharacterRemoving:Connect(characterRemoving)
}
if (player.Character) then
characterAdded(player.Character)
end
end
my character doesnt move and the issue is here
for i,player in pairs (PS:GetPlayers()) do
playerConnections[player.Name] = {
CharacterAdded = player.CharacterAdded:Connect(characterAdded),
CharacterRemoving = player.CharacterRemoving:Connect(characterRemoving)
}
if (player.Character) then
characterAdded(player.Character)
end
end
Y_VRN
(Y_VRNDLL)
January 8, 2023, 2:29pm
#2
Please describe your problem further. You can provide related errors from the output, and specific what you want to achieve.
Also, please use ``` to properly display your code.
Like this:
```
code
```
will display as
code
az2166
(Dream)
January 8, 2023, 2:31pm
#3
theres no output errors, my character just cant walk n the problem is here
for i,player in pairs (PS:GetPlayers()) do
playerConnections[player.Name] = {
CharacterAdded = player.CharacterAdded:Connect(characterAdded),
CharacterRemoving = player.CharacterRemoving:Connect(characterRemoving)
}
if (player.Character) then
characterAdded(player.Character)
end
end
Y_VRN
(Y_VRNDLL)
January 8, 2023, 2:34pm
#4
How does the character not move? Is it floating in the air (try moving your character using the Move tool while playing. Is it not going down?)? Did it fall down on the floor? Is it standing, but not moving left and right?
xDeltaXen
(xDeltaXen)
January 8, 2023, 2:38pm
#6
end
local function characterRemoving(character : Model)
character.Hitbox:Destroy()
end
PS.PlayerAdded:Connect(function(player : Player)
playerConnections[player.Name] = {
CharacterAdded = player.CharacterAdded:Connect(characterAdded),
CharacterRemoving = player.CharacterRemoving:Connect(characterRemoving)
}
end)
PS.PlayerRemoving:Connect(function(player : Player)
playerConnections[player.Name].CharacterAdded:Disconnect()
playerConnections[player.Name].CharacterRemoving:Disconnect()
playerConnections[player.Name] = nil
end)
for i,player in pairs (PS:GetPlayers()) do
playerConnections[player.Name] = {
CharacterAdded = player.CharacterAdded:Connect(characterAdded),
CharacterRemoving = player.CharacterRemoving:Connect(characterRemoving)
}
end
Y_VRN
(Y_VRNDLL)
January 8, 2023, 2:39pm
#7
Is your hitbox model anchored?
az2166
(Dream)
January 8, 2023, 2:40pm
#8
nope the hitbox belongs to the plant
Y_VRN
(Y_VRNDLL)
January 8, 2023, 2:41pm
#9
No, is the hitbox’s Part.Anchored
property set to true (in the Properties window)?
az2166
(Dream)
January 8, 2023, 2:43pm
#10
No, the hitbox Part.Anchored property is set to unticked
Y_VRN
(Y_VRNDLL)
January 8, 2023, 2:57pm
#11
I attempted to reproduce the issue, but no problems occurred. I can also move my character. Your script isn’t the problem, it’s something else (or it could still be your script, just not anywhere in your code snippet.)
Can you send the rest of the code?
az2166
(Dream)
January 8, 2023, 5:59pm
#12
I ended up fixing it bro its fine