Anybody help me with this? i'm suffering over here, just errors all the time.
function leftClick() script.Parent.MouseButton1Click:Connect(leftClick) local NPC = game.ReplicatedStorage.angrymunci["NextbotV1.5"]:Clone() NPC.SetPrimaryPartCFrame(15.391, 84.829, -150.20) NPC.Parent = game.Workspace.bots end
First of all, when using methods like SetPrimaryPartCFrame()
, use colons instead of dots. If you want to use dots, you can add the instance you're using the method with as the first parameter, but colon is way more recommended than that.
Second, when setting a CFrame, make sure to make the 3 numbers a CFrame by using CFrame.new()
and inside the parentheses you put the 3 numbers.
And lastly, connect the function outside the function itself and not inside.
local function leftClick() local NPC = game.ReplicatedStorage.angrymunci["NextbotV1.5"]:Clone() NPC:PivotTo(CFrame.new(15.391, 84.829, -150.20)) NPC.Parent = game.Workspace.bots end script.Parent.MouseButton1Click:Connect(leftClick)
function leftClick() local NPC = game.ReplicatedStorage.angrymunci["NextbotV1.5"]:Clone() NPC.SetPrimaryPartCFrame(15.391, 84.829, -150.20) NPC.Parent = game.Workspace.bots end script.Parent.MouseButton1Click:Connect(leftClick)
function leftClick() local NPC = game.ReplicatedStorage.angrymunci["NextbotV1.5"]:Clone() NPC.PrimaryPart = NPC:FindFirstChild("Torso") NPC.PrimaryPart.CFrame = CFrame.new(15.391, 84.829, -150.20) NPC.Parent = game.Workspace.bots end script.Parent.MouseButton1Click:Connect(leftClick)
im not good at scripting so this might not work