#I Cant Make it

51 messages · Page 1 of 1 (latest)

vital flame
#

I want my creature model to form a little behind the player after passing a part, but I can't do it, I don't know much about coding, I tried to do it with chatgpt but I failed, can someone help me?

olive ledge
#

heres a basic code for making it appear behind the player

vital flame
#

like a chasing scene

olive ledge
#

alright

vital flame
#

i made everything like animation model

olive ledge
#

is your monster one part/a mesh, or is it a multiple part model?

vital flame
#

Multiple Part Model

olive ledge
#

If its a monster/creature it has a humanoidrootpart, right?

vital flame
#

Yea

olive ledge
#

ok

#

heres how you can make anything appear behind the player

—local script

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait() — basically either references the character or waits for it to load since characteradded returns the character
local HRP = Character:WaitForChild(“HumanoidRootPart”)

local Monster = workspace:WaitForChild(“MonsterName”) — path to your monster and also i will for the sake of simplicity assume your monster is one part. ChNge the path to your monster as needed
local MonsterHRP = Monster:WaitForChild(“HumanoidRootPart”)

— im not sure what you use to signal the monster to move but heres how it should look (code for monster being behind player)

MonsterHRP.Position = HRP.Position - Vector3.New(x, y, z) — this is dependsnt on the monster being rigged and following the humanoidrootpart, also, take into consideration this changes only the position not the cframe, meaning orientation stays the same as previous. i suggest tweaking the cframe instead as this is just a basic code.
the - line should be used to calculate behind trhe player, and again, i suggest using cframe as this is a very basic vector3 system
vital flame
#

okayy

#

but can you say about

#

how to put it : D

olive ledge
#

i dont really know your project/game or irs mechanics

#

but

#

basically

vital flame
#

im just trying to make a block when a playerit monster will appear

olive ledge
#

just put this line: MonsterHRP.Position = HRP.Position - Vector3.New(x, y, z) into the Part.Touched event

olive ledge
#

and also be sure to check if its the player touching it

#

using Part.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild(“Humanoid”) then
MonsterHRP.Position = HRP.Position - Vector3.New(x, y, z)
end
end)

#

be sure to include the variables and happy coding

vital flame
#

thanks

olive ledge
vital flame
#

@olive ledge

#

im still trying to use the code

#

if you have time

#

can you help me with it on studio

olive ledge
#

im a little busy right now, i'll see

vital flame
vital flame
olive ledge
#

but im still here to help

vital flame
#

im still tryin

olive ledge
#

Alright

#

heres a rundown of how to use my script

#

well its kind hard to explain but easy to execute

#

look it wont make sense unless i either spoon feed u

#

or you know something about scripting

#

from what i understand is that you’re really new to scripting and know 0 for now

vital flame
#

yeah you're right

olive ledge
#

i suggest learning the basics, but just the basics, and then starting to apply your own knowledge

#

use chatgpt to help explain topics or thinfs you’d like to know

#

but not for script creation

vital flame
#

i got your script but i dont know how to change the setting's of that

#

it's the problem

olive ledge