How can i add a end at line 15? Line 15 is in the middle of the text block (not the whole script, just the Event part.)
Event.OnServerEvent:Connect(function()
local Event = Instance.new("RemoteEvent")
local Velocity = script.Parent.Stage1.Union.BodyVelocity
local Union = script.Parent.Stage1.Union
local Event2 = Instance.new("RemoteEvent")
local Event3 = Instance.new("RemoteEvent")
local Dragon = script.Parent.Dragon
Event.Parent = game.ReplicatedStorage
Event2.Parent = game.ReplicatedStorage
Event3.Parent = game.ReplicatedStorage
Event.Name = "Launch"
Event2.Name = "MECO"
Union.Anchored = true
Union.BodyVelocity.Velocity = Vector3.new(0,35,0)
Event.OnServerEvent:Connect()
end
Union.Anchored = false
game.ReplicatedStorage.Event2.OnServerEvent:Connect(function()
Union.MotionHandler:Destroy()
Union.BodyVelocity:Destroy()
Union:Destroy()
end)
You have too many ends. That end in the middle shouldn’t be there, but the line two above it needs to have an argument or it will error, since it currently doesn’t connect to an event.
Argument? what is an argument??? can you give me an example of one?
This is an example of a function with arguments.
string.split(ARGUMENT,ARGUMENT)
So how would a add a argument into here? i am confused.
Is the second block of code connected to the first one?
1 Like
You didn’t add a function()…
Event.OnServerEvent:Connect(function()
end)
Warrior15005:
local Event = Instance.new("RemoteEvent")
local Velocity = script.Parent.Stage1.Union.BodyVelocity
local Union = script.Parent.Stage1.Union
local Event2 = Instance.new("RemoteEvent")
local Event3 = Instance.new("RemoteEvent")
local Dragon = script.Parent.Dragon
Event.Parent = game.ReplicatedStorage
Event2.Parent = game.ReplicatedStorage
Event3.Parent = game.ReplicatedStorage
Event.Name = "Launch"
Event2.Name = "MECO"
Union.Anchored = true
Union.BodyVelocity.Velocity = Vector3.new(0,35,0)
Event.OnServerEvent:Connect(function()
— Code Here
end)
Union.Anchored = false
game.ReplicatedStorage.Event2.OnServerEvent:Connect(function()
Union.MotionHandler:Destroy()
Union.BodyVelocity:Destroy()
Union:Destroy()
end)
Your code should look like this if I’m not mistaken, I’ve fixed the formatting and ends.
Problem: game.ReplicatedStorage.Event2 was never defined, you named it “MECO”
So it should be
game.ReplicatedStorage.MECO.OnServerEvent:Connect(function()
Union.MotionHandler:Destroy()
Union.BodyVelocity:Destroy()
Union:Destroy()
end)