Help with Support Script

Hello developers, I am trying to accomplish a support script with a teleportation button. However, the teleportation part doesn’t seem to work.

local Player = game.Players.LocalPlayer

game.ReplicatedStorage.HelpNotifierEvent.OnClientEvent:Connect(function(PlayerNeedingHelp)
	local playerRoot = Player.Character:FindFirstChild('HumanoidRootPart')
	local a = Player
	local b = Player
	local playerRoot = Player.Character:FindFirstChild('HumanoidRootPart')
	local bHumanoid, bHumanoidRootPart = b.Character:FindFirstChildOfClass("Humanoid"), b.Character:FindFirstChild("HumanoidRootPart")
	local TeleportPlayer = Instance.new("BindableFunction")
	TeleportPlayer.OnInvoke = function()
		bHumanoidRootPart.CFrame = (playerRoot.CFrame*CFrame.Angles(0,math.rad(90/#Player*a),0)*CFrame.new(5+.2*#Player,0,0))*CFrame.Angles(0,math.rad(90),0)
	end
	
	game.StarterGui:SetCore("SendNotification", {
		Title = "Player Needs Help",
		Text = PlayerNeedingHelp.Name .. " is in need of assistance.",
		Duration = 15,
		Button1 = "Teleport",
				Callback = TeleportPlayer
		})
end)

Could be entirely wrong but I’m pretty sure the callback needs to be a function

1 Like

Needs to be a reference to a ‘BindableFunction’ object which is then invoked when the respective button is clicked/tapped/pressed etc.
https://developer.roblox.com/en-us/api-reference/function/StarterGui/SetCore