local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humrp = char:WaitForChild("HumanoidRootPart")
local uis = game:GetService("UserInputService")
local debris = game:GetService("Debris")
local part = Instance.new("Part")
local effect = game:GetService("ReplicatedStorage").VP
part.Transparency = 1
part.CanCollide = false
local debounce = false
uis.InputBegan:Connect(function(input, istyping)
if istyping then return end
if debounce then return end
if input.KeyCode == Enum.KeyCode.E then
debounce = true
local clone = part:Clone()
local clone2 = effect:Clone()
clone.Parent = workspace
clone2.Parent = clone
clone.CFrame = humrp.CFrame
clone2.Enabled = true
task.wait(0.1)
humrp.CFrame = humrp.CFrame * CFrame.new(0,0,-10)
print("ok")
debris:AddItem(clone,3)
wait(3)
debounce = false
end
end)
After reproducing your code in a baseplate with a part and a particle emitter, your clone part does get cloned and parented to the workspace but its anchored property is false and it having cancollide makes it fall off the world. So try setting the .Anchored property of your clone to true before parenting to workspace
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humrp = char:WaitForChild("HumanoidRootPart")
local uis = game:GetService("UserInputService")
local debris = game:GetService("Debris")
local part = Instance.new("Part")
local effect = game:GetService("ReplicatedStorage"):WaitForChild("VP")
part.Transparency = 1
part.CanCollide = false
local debounce = false
uis.InputBegan:Connect(function(input, istyping)
if istyping or debounce then return end
if input.KeyCode == Enum.KeyCode.E then
debounce = true
local clone = part:Clone()
local clone2 = effect:Clone()
clone.Anchored = true
debris:AddItem(clone,3)
clone.Parent = workspace
clone2.Parent = clone
clone.CFrame = humrp.CFrame
clone2.Enabled = true
task.wait(0.1)
humrp.CFrame = humrp.CFrame * CFrame.new(0,0,-10)
print("ok")
task.wait(3)
debounce = false
end
end)
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humrp = char:WaitForChild("HumanoidRootPart")
local uis = game:GetService("UserInputService")
local debris = game:GetService("Debris")
local part = Instance.new("Part")
local effect = game:GetService("ReplicatedStorage").VP
part.Transparency = 1
part.CanCollide = false
local debounce = false
uis.InputBegan:Connect(function(input, istyping)
if istyping then return end
if debounce then return end
if input.KeyCode == Enum.KeyCode.E then
debounce = true
local clone = part:Clone()
clone.Anchored = true
local clone2 = effect:Clone()
clone.Parent = workspace
clone2.Parent = clone
clone.CFrame = humrp.CFrame
clone2.Enabled = true
task.wait(0.1)
humrp.CFrame = humrp.CFrame * CFrame.new(0,0,-10)
print("ok")
debris:AddItem(clone,3)
wait(3)
debounce = false
end
end)