Alright, let's recreate the situation. I have a LocalScript in my StarterPack and a normal Script in my ServerStorage. The LocalScript creates a brick at the mouse pointer when the mouse button is pressed and the Script is used to keep the part at it's position, but every time I walk by, it moves up.
-- LocalScript in StarterPack local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.Button1Up:connect(function() local Part = Instance.new("Part", Workspace) Part.CanCollide = true Part.Anchored = true Part.Size = Vector3.new(1,10,10) Part.Position = mouse.Hit.p) local Script = game.ServerStorage.Script:Clone() Script.Parent = Part end)
-- Script in ServerStorage local Part = script.Parent while wait() do if Part.Position.y > 0 then Part.Position = Vector3.new(Part.Position.x, 0, Part.Position.z) end end
Does anyone know how I can make a Part stay at it's position, even though the player spawned it on top of his head?
Since you have "while wait() do" the part keeps moving?
I would just do this.
--LocalScript in StarterGear or StarterGui. local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.Button1Down:connect(function() --Your call statement. local Part = Instance.new("Part", game.Workspace) --Creates your brick and puts it into game.Workspace. Part.Anchored = true Part.CanCollide = true Part.Transparency = 0 Part.BrickColor = BrickColor.new("Bright red") --Any color, Just lets you see your brick better. Part.Size = Vector3.new(1, 10, 10) Part.Position = Mouse.Hit.p local SetPosition = Part.Position while wait() do Part.Position = SetPosition end end)