Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Does anyone know about moving with vector and random choosing for blocks?

Asked by 4 years ago

So I'm working for this game that sounds really good, the trouble is, that the scripts are just dying, it doesn't want to work. Help! Script 1

game.Workspace.Buttonaclicked.OnServerEvent:Connect(function()
    function abuttonclicked()
end)

LocalScript 1

local clickdetector = game.Workspace.EnemyArea.Buttons.ButtonA.ClickDetector
clickdetector.MouseClick:Connect(function()
    game.Workspace.Buttonaclicked:FireServer()
end)

local clickdetector = game.Workspace.EnemyArea.Buttons.ButtonB.ClickDetector
clickdetector.MouseClick:Connect(function()
    game.Workspace.Buttonbclicked:FireServer()
end)

local clickdetector = game.Workspace.EnemyArea.Buttons.ButtonC.ClickDetector
clickdetector.MouseClick:Connect(function()
    game.Workspace.Buttoncclicked:FireServer()
end)

Script 2

function ButtonBClicked()
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 8.405)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 10.117)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 12)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 14)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 16)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 19)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 23)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 28)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 31.62)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 37.726)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodB.Position = Vector3.new(-10.004, 18.21, 43.749)

end
function ButtonaAClicked()
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 8.405)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 10.117)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 12)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 14)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 16)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 19)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 23)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 28)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 31.62)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 37.726)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodA.Position = Vector3.new(0.067, 18.259, 43.749)
end
function ButtonCClicked
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 8.405)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 10.117)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 12)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 14)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 16)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 19)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 23)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 28)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 31.62)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 37.726)
    wait(0.5)
    game.Workspace.EnemyArea.FoodsChoice.FoodC.Position = Vector3.new(10.26, 18.21, 43.749)

I also need to make it to only register for the enemy team not the people running on the conveyor.

(I can do most of it, just the button for moving the block forward and randomly choose to their kill or make the player slower or freeze the player)

Answer this question