local Player = game:GetService("Players").LocalPlayer
local shopkeeper2 = workspace.shopkeeper2
local camera = workspace.CurrentCamera
script.Parent.Triggered:Connect(function(player)
local character = player.Character
if not character then return end
character:PivotTo(CFrame.new(workspace.thisNameOther.Position))
shopkeeper2:PivotTo(CFrame.new(workspace.shopkeeperto.Position))
print("Teleported") -- Does this print?
cam.CameraType = Enum.CameraType.Fixed
cam.Focus = shopkeeper2.CFrame
print("Set camera") -- Does this print?
local rage = Player.PlayerGui.Rage
rage.Enabled = true
print("Enabled GUI") -- Does this print?
task.wait(2)
character.Humanoid.Health = 0
print("Killed") -- Does this print?
end)
That errors means in this line the variable Player is nil. if we go to where Player is defined we see that it is trying to get the LocalPlayer, which doesn’t exist for the Server, therefor nil. Move your code from a Script (server-side) to a LocalScript (client-side)
local Player = game:GetService("Players").LocalPlayer