Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need a little bit of help. How do I make a brick face me?

Asked by 5 years ago

I really want to know how to make a brick stare at me so I can make an enemy for my game. Could anybody help?

0
I've looked all over the internet. on YouTube, on Google, on Here, Everywhere. I still couldn't find anything. HypnoZombe 0 — 5y
0
Try to write something yourself; we can help you if you something goes wrong or you get stuck. Optimalpokemon123 37 — 5y
0
Thanks :) HypnoZombe 0 — 5y
View all comments (2 more)
0
Sorry if I mess up or need help. I'm actually pretty new to scripting. HypnoZombe 0 — 5y
0
For the following script to work, there must be a Part named "Part" in `Workspace`. This script must also be located in LocalScript. Since I have no idea on what your "Enemy" is, I cannot help you there unless you send me a picture of it. Zafirua 1348 — 5y

1 answer

Log in to vote
0
Answered by
Zafirua 1348 Badge of Merit Moderation Voter
5 years ago

One of my ways of achieving this problem is by using Humanoid Root Part's CFrame, Position along with a Part's Position

-- [Declaration Section]
--\\ Game Services   
local Player           = game:GetService("Players").LocalPlayer;
local Character        = Player.Character or Player.CharacterAdded:Wait();
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart");

--\\ Part Location
local Part             = workspace.Part;

-- [Output Section]
repeat wait()
    HumanoidRootPart.CFrame = CFrame.new(HumanoidRootPart.Position, Part.Position);
until HumanoidRootPart.CFrame == CFrame.new(HumanoidRootPart.Position, Part.Position);

0
Thank you for your help, but I copied and pasted it in, and the enemy wouldn't stare at me. HypnoZombe 0 — 5y
Ad

Answer this question