Local script not running inside r15 rig

Hello. I am currently making an interact script but for some reason my local script wont run. I’ve tried printing and searching in the devforum but nothing worked. Here’s the script:

--|| Services ||--
local runservice = game:GetService("RunService")
local tweenService = game:GetService("TweenService")

--|| Instances ||--

--| Player |--	
local LocalPlayer = game.Players.LocalPlayer
local char = game.Workspace:WaitForChild(LocalPlayer.Name)
local hrp = char:WaitForChild("HumanoidRootPart")

--| Dummy |--
local dummy = script.Parent.Parent
local dummyHrp = script.Parent
local billboardGui = dummyHrp:WaitForChild("BillBoardGui")

--|| TweenService ||--

--| Goals |--

local billboardGoal = {
	Size = Vector3.new(0.5, 0, 0.5, 0)
}

local billboardEndGoal = {
	Size = Vector3.new(0, 0, 0, 0)
}

--| TweenInfo |--

local billboardInfo = TweenInfo.new(1)

--| Create Tween |--

local billboardOpenTween = tweenService:Create(billboardGui, billboardInfo, billboardGoal)
local billboardCloseTween = tweenService:Create(billboardGui, billboardInfo, billboardEndGoal)

--|| Script ||--

runservice.Heartbeat:Connect(function()
	if (hrp.Position - dummyHrp.Position).magnitude <= 10 then
		billboardOpenTween:Play()
	else
		billboardEndGoal:Play()
	end
end)

Local scripts only work on the players client. The r15 rig typically won’t be client side unless you are working in a viewport frame, etc… You need to use a server script for this.

1 Like