Hi all, trying to create a parameters system - but to no avail. I’ve tried searching youtube, google, the DevForum (found some posts similar- none answering my questions though) and asking around on chats… no help recieved. The way this system is supposed to work is that there are 6 parts, (2 parts for each axis), the point of this is to check if a character is situated in a certain area. This is my first time attempting some sort of system like this, the code below is how I imagined it to be;
function getParams(char,x,x2,z,z2,y,y2)
local humRoot = char:FindFirstChild("HumanoidRootPart")
local humPos = humRoot.Position
if humPos.Z > z2 and humPos.Z < z and humPos.Y > y and humPos.Y < y2 and humPos.X > x and humPos.X < x2 then
print("returned true")
return true
end
end
local Params = currentFloo.Parameters -- this is the model which contains the 6 parts
if getParams(FlooPlr.Character,Params.x.Position.X, Params.x2.Position.X, Params.z.Position.Z, Params.z2.Position.Z, Params.y.Position.Y, Params.y2.Position.Y) == true then
-- puts what i want the script to do here
end
This is what the 6 parts location looks like;
The issue is that nothing seems to be happening. No printing, etc… I’m unsure what the issue is because this is my first time making a system like this but any feedback would be welcomed!
I await your responses, any help/feedback is appreciated - posts, videos etc.