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

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

Asked by 5 years ago
Edited 5 years ago

--(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

Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

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

Ad

Answer this question