i need help with a certain frusterating script that when i tell it to randomize and clone itself it isnt even doing that
game.ReplicatedStorage.RemoteTools.RandomizedLargeBoneWall.OnServerEvent:Connect(function(plr)
local chr = plr.Character
local humanoidrootpart = chr:FindFirstChild("HumanoidRootPart")
local RandomBone = rep.ToolModle.LargeBoneWallFolder:GetChildren()
local RandomizedIndex = math.random(1, #RandomBone)
local bone = RandomBone[RandomizedIndex]:Clone()
local main = game.ServerStorage.MovingScript:Clone()
local damage = game.ServerStorage.DamageScript:Clone()
local value = Instance.new("StringValue")
if bone.Name == "BlueLargeBoneWall" then
print("LargeWallBlue")
elseif bone.Name == "OrangeLargeBoneWall" then
print("OrangeWallBONE")
end
damage.Parent = bone
value.Parent = bone
value.Value = plr.Name
bone.Parent = workspace
bone.CFrame = humanoidrootpart.CFrame * CFrame.new(0, -10, -3)
for i = 1, 10 do
bone.CFrame = bone.CFrame * CFrame.new(0, 1, 0)
wait(0.1)
end
main.Parent = bone
wait(7)
main:Destroy()
for i = 1, 10 do
bone.CFrame = bone.CFrame * CFrame.new(0, -1, 0)
wait(0.1)
end
bone:Destroy()
end)
is there anything wrong in my script?