Hello everyone. I am trying to make a rocket system, but I can not figure out, why when I change x it goes up and when y it goes x?
local part = script.Parent
local go = true
local y = 1
local degreec = 0
game.Workspace.Baseplate.Touched:Connect(function(hit)
if hit.Name == "Rocket" then
hit:Destroy()
go = false
end
end)
while y <= 100 do
part.CFrame = part.CFrame:ToWorldSpace(CFrame.new(0, 1, 0))
task.wait(0.01)
y += 1
end
Check the pivot point. Since you have simple part’s you can just rotate the part so that Y-axis is pointing up and resize the part. Or optionally change the pivot orientation/reset pivot.
local UserInputService = game:GetService("UserInputService")
local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
UserInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 and Mouse.Target == game.Workspace.Button then
print("click")
RemoteEvent:FireServer()
end
end)
Server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
local Rocket = ReplicatedStorage.Rocket
local Positions = {CFrame.new(-3, 3, -37), CFrame.new(1, 3, -37), CFrame.new(5, 3, -37), CFrame.new(9, 3, -37), CFrame.new(13, 3, -37)}
RemoteEvent.OnServerEvent:Connect(function(player)
for i, v in Positions do
local a = Rocket:Clone()
a.CFrame = v
a.CFrame = a.CFrame * CFrame.Angles(0, math.rad(90), math.rad(90))
a.Parent = game.Workspace
end
end)