You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
As the title says I want to spawn a model next to me and make them attack everyone except for me. So I made a class system and in that class system there is a set of skills and movesets that goes to the player that picks that class and one of the classes has a skill that he summons some soldier that attacks everyone except for me -
What is the issue? Include screenshots / videos if possible!
I don’t know how to teleport them and I don’t know how to make the npc attack everyone else but me. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried searching this up in forums and youtube but I cant find anything. For the teleport part I tried putting the model somewhere like in the serverstorage and then when I press Q I did something like
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
elseif input.KeyCode == Enum.KeyCode.Q then
Model.Parent = game,workspace
Model.HumanoidRootPart.CFrame = Model.HumanoidRootPart.CFrame*CFrame.new(0,0,5)
I tried something like this for the teleport part but it doesn’t do anything.(I didn’t put the exact script I have because my script is a lot messier than this)
As for the npc attacking part I watched a tutorial about this but I can’t find any tutorials about making it not attack/follow me
But the script goes like
local RomanRoot = script.Parent.HumanoidRootPart
local RomanHumanoid = script.Parent.Humanoid
local function findenemy()
local aggro = 500
local target = nil
for i,v in pairs(game.Workspace:GetChildren()) do
local human = v:FindFirstChild("Humanoid")
local root = v:FindFirstChild("HumanoidRootPart")
if human and root and v ~= script.Parent then
if (RomanRoot.Position - root.Position).Magnitude < aggro then
aggro = (RomanRoot.Position - root.Position).Magnitude
target = root
end
end
end
return target
end
while wait(1) do
local torso = findenemy()
if torso then
RomanHumanoid:MoveTo(torso.Position)
end
end
Also I’m pretty new so I don’t know how to script and I probably only know like half the basics.