Valkyrop
(aHuman)
August 31, 2022, 2:26pm
2
Okay. Then something like this should work:
-- Server code
local part = <your part>
local prevCFrame = part.CFrame
local detectChange = game:GetService("RunService").HeartBeat:Connect(function()
if part.CFrame ~= prevCFrame then
part:Destroy()
detectChange:Disconnect() -- I have not used this before, but I think this is correct.
end
end)
--For this one, you'll need a `CFrameValue`.
Workspace.CFrameValue.Changed:Connect(function(NewValue)
print(NewValue)
end)
Workspace.CFrameValue.Value = CFrame.new(0, 20, 0)
So recently I’ve been making a mini-map and I want to locate all the NPC’s in the world. I’ve been trying to detect for any position or CFrame updates but I am unable to do so on the PrimaryPart of the NPC:
local function trackBlueMinion(Minion)
local MinionTracker = LocationPart:Clone()
MinionTracker.Position = Minion.PrimaryPart.Position
MinionTracker.Color = Color3.fromRGB(0, 0, 255)
MinionTracker.Name = Minion.Name.."'s Tracker"
MinionTracker.Parent = MapDisplay.blue
print(Minion.Name…
How would I listen for a player movement event? That includes falling due to gravity
1 Like