Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have an 'end)' underlined in red but i dont know what to do to fix it. Can Someone Help me plz?

--(Its Putting It Out Of Its Lines, Srry If Its Confusing Because of that)

local SellButton = script.Parent.WaitForChild("SellButton") local UpgradeButton = script.Parent.WaitForChild("UpgradeButton") local CloseButton = script.Parent.WaitForChild("CloseButton")

local Player = game.Players.LocalPlayer

local ReplicatedStorage = game.ReplicatedStorage local RemoteEvents = ReplicatedStorage.RemoteEvents local TeleToShop = RemoteEvents.TeleportToShop local TeleToSell = RemoteEvents.TeleportToSell

SellButton.LeftMouseButtonDown:Connect(function() script.Parent.Visible = false wait(0.5) TeleToSell:FireServer end) -- <----------------------------------------------- Over Here

TeleportButton.LeftMouseButtonDown:Connect(function() script.Parent.Visible = false wait(0.5) TeleToShop:FireServer end)

CloseButton.LeftMouseButtonDown:Connect(function() script.Parent.Visible = false end)


                                                   and In Another Script


local ReplicatedStorage = game.ReplicatedStorage local RemoteEvents = ReplicatedStorage.RemoteEvents local TeleportToShop = RemoteEvents.TeleportToShop local TeleportToSell = RemoteEvents.TeleportToSell

TeleportToSell.OnServerEvent:Connect(function(Player) local Characrer = Player.Character Characrer:MoveTo(game.Workspace.Overworld.Sell.SellPart + Vector3.new(0,2,0)) end)

TeleportToShop.OnServerEvent:Connect(function(Player) local Characrer = Player.Character Characrer:MoveTo(game.Workspace.Overworld.Shop.ShopPart + Vector3.new(0,2,0)) end)

1 answer

This is because “FireServer”’s parentheses are missing. This is a function, all function must be called with parentheses. Also, it’s :WaitForChild. In your second Script you’ll have a problem that may look of the sorts Expected Vector3, got Object) on your :MoveTo() lines. You gave it the Part, and forgot to give it the Part’s Position. This can be done by .Position

This discussion is preserved as it was. New answers, comments, and votes are closed.