#help with movement script

1 messages · Page 1 of 1 (latest)

split salmon
#

im making a script that lets a player click on a unit to move it to a location, however, i cant find a way to do this while 1. making sure the unit doesnt fly up (game is top down so clicking where the unit is currently makes it go up) and 2. making movement exclusive to the unit (idek how but i am moving the baseplate when i click prob cus there's no check but idek how to add a check) screenshots are of the local code and serverside code

#

ill send a video of the error rq

#

(it's meant to be IsA ("BasePart") btw

brazen orchidBOT
#

studio** You are now Level 3! **studio

split salmon
#

just realized i have player variable twice in there

#

oh wait

#

nvm then

#

hmm i have an idea

#

boom fixed it

#

if anyone is curious i added this function

local function getInfantryModel(part)
local model = part:FindFirstAncestorOfClass("Model")
if model and model.Name == "Infantry" then
return model.PrimaryPart or model:FindFirstChildWhichIsA("BasePart")
end
return nil
end

and then used it to check if the part is the infantry unit