Player doesn't change location?

  1. Click the Result in Output Box → Change Player Location to the object clicked in the search result

  2. Player location doesn’t change after I click the search result

  3. I tried to find the problem in my script. But no luck.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block
local ScrollingBoxScreenGui = script.Parent
local ScrollingFrame = ScrollingBoxScreenGui.Frame.ScrollingFrame

local searchEvent = game.ReplicatedStorage.SearchEvent -- Change 'SearchEvent' to your RemoteEvent name

-- Function to add items to the scrolling frame
local function AddItem(text)
	local item ="TextButton") -- Use TextButton instead of TextLabel for clickable items
	item.Parent = ScrollingFrame
	item.Size =, 0, 0, 30) -- You can adjust the size as needed
	item.Position =, 0, 0, #ScrollingFrame:GetChildren() * 30) -- Vertically position the item
	item.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
	item.Text = text
	item.TextSize = 20

	-- Add a click event handler
		-- Teleport the player to the selected location
		local targetPosition =, 10, 0) -- Replace this with the actual position of the selected location

-- Listen for the search event from the server
	-- Clear existing items in the scrolling frame
	for _, item in ipairs(ScrollingFrame:GetChildren()) do

	-- Add search results to the scrolling frame
	for _, result in ipairs(results) do

Not sure what could be wrong with the click even handler.

Anyone any ideas?
Appreciate any little help.

You can download the .rbxl place file right here:
Click Event Location.rbxl (59.6 KB)

1 Like