Help with CFrame

It is putting it out in the output in studio, but not in the developer console in roblox. (I published and updated servers)

Check to see if your API Services are all enabled? And make sure that the tool’s name (I’m guessing it’s a tool) is exact within the Player’s backpack

I just re-started studio to check if my studio bugs.
And the publish did not worked properly before probaly, as now it works fine.
Thanks for all the replies! I appreciate it.

1 Like

Definitly a weird one, not sure why it’s erroring but we can work around this.

local plr = game:GetService("Players").LocalPlayer
local Room101tp =  workspace:WaitForChild("Roomteleportblocks").Room101tp

local function SetCharCFrame()
    local plrCharacter = workspace:FindFirstChild(plr.Name)
    if not plr:FindFirstChild("Room 101") or not plrCharacter then return end

    plrCharacter.HumanoidRootPart.CFrame = Room101tp.CFrame
end
script.Parent.ClickDetector.MouseClick:Connect(SetCharCFrame)

do something like
this is bad variable naming, just an example

local p = game.Players.LocalPlayer
local c = p.Character or p.CharacterAdded:Wait()

The script that is being used seems to be running on the server not the client so localPlayer will be nil / error

1 Like

May want to make it clear a solution has been found by marking one of the replies as a solution

The event won’t even run then.

1 Like

Click detector events will run on the server and pass the player that clicked as an argument to the connected function. Heres the link to the mouseclick event ClickDetector | Documentation - Roblox Creator Hub

1 Like

The issue was already fixed. My studio bugged and it didn’t published the first script.
I had to re start studio for it to work.
Thanks for all the replies though! <3

My bad, only briefly read it, thought it was a UI event click.

1 Like